PHP

PHP Verify a Dollar Amount

By |2014-01-05T10:23:29+00:00March 8th, 2012|Code, PHP|

Just a simple function to see if an input numeric value is actually a US Dollar (USD) format\r\nExample:\r\nTwo Dollar Amounts provided to the script.. 1502.38 and 10O.00\r\n\r\nGood: 1,502.38\r\nBad: 10O.00 came back false. \r\n […]

PHP Validate Credit Card format

By |2014-01-05T10:23:51+00:00March 8th, 2012|Code, PHP|

Are you in a bind trying to figure out if that user input credit card number is valid as far as format goes. Not just length but the actual combination of numbers as well? Well then here is a quickie solution. […]

PHP Unix TimeStamp to mySQL DATETIME

By |2012-03-08T15:50:18+00:00March 8th, 2012|Code, PHP|

\r\nSometimes you jut want to have a ready need to take a recalculated timestamp from a past/future date and store it in your DB this little function helps achieve that, I notice a lot of people especially newer coders who have a passion for time() timestamps as they are in a sense easier to work [...]

PHP Shorten (Truncate) Text / Strings

By |2014-01-05T10:25:33+00:00March 8th, 2012|Code, PHP|

Just a simple function to take any given string and just shorten it. Sometimes you have an column in your DB thats a few paragraphs long but the page you want to display a snippet of the column only has room for 50 characters (or however many you can spare).\r\n\r\nAn example would be:\r\n […]

PHP get clients IP Address (Whats My IP Address)

By |2014-01-05T10:26:23+00:00March 8th, 2012|Code, PHP|

Just a simple function to get someones IP, I know most people have a one liner for this, problem with that I found is sometimes you get invalid and or empty results. My little function aims to work around the common issues that may cause an IP to come back wrong and get it regardless. [...]

PHP Show time Since a given date/time

By |2016-10-27T00:23:53+00:00March 8th, 2012|Code, PHP|

Just a simple function to determine based on a UNIX timestamp how long ago something was done and display it in a readable format. Example of this is I am posting this even though I don’t know how long I’ve been actually using this; […]

PHP OS (Operating System) Detection

By |2014-01-05T10:29:06+00:00January 27th, 2012|Code, PHP|

Now a days with cross browser compatibility issues ranging outside of just Windows/PC as Mac’s and Linux become more user friendly and popular you get issues that aren’t necessarily the same thing cross OS’s now. Example something I do in chrome on my Windows PC works well, where on my MAC it fails. So what [...]

PHP Random String Generator a-z 0-9 function

By |2014-01-05T10:29:16+00:00January 27th, 2012|Code, PHP|

Lets face it sometimes there’s just a need to have a random string for whatever purpose usually an initial password if you want to create a verification method for your site, usually a randomly generated password someone has to input first is a good means. Its one of the easier ones I know that. [...]