PHP Code Snippets by Hawkee
(14)
This is a little snippet that will remove any non-ASCII characters from a string.
+ 0 likes
This will extract a zip file via PHP. Just be sure to set the $file and $path variables. $file represents the zip file name which may or may not contain a path. $path represents the directory to extract..
+ 0 likes
This will assign font sizes to tags based on their counts. It tries to evenly distribute the font sizes among the tags while keeping all tags with the same counts under the same font size. The data needs..
+ 0 likes
I thought this was pretty neat and useful. You can combine strtotime with the date function to create your own date verbally. This is just an alternative to using mktime that's a little more intuiti..
+ 0 likes
This is a ready to go PHP script that can be pasted into a blank .php document. Run it through your webserver after changing $myemail to the value of your E-Mail address. It also sends the referring..
+ 0 likes
This generates two structures: a tree and a list of objects. Both are generated from the following standard parent/child database format:
- cat_id: primary key, auto_increment
- cat_title: name of..
+ 0 likes
I use this almost every day. It's one of the most useful PHP debugging tools. You can print all of the contents of a variable (class, array or scalar) to get an idea of how the structure looks.
Tags:
printr
+ 0 likes
This will convert a sortable YYYY-MM-DD date into a more presentable date. $date can be set to any date as long as it fits this format.
+ 0 likes







