Posted at 11:44, February 10 2010
strip_tags()
Just found this useful little guy, strip_tags() that strips HTML and PHP tags from a string.
So many functions lying around in PHP, it’s hunting them out that’s difficult.
Posted at 14:40, January 13 2010
PHP: Remove empty elements from array
So I don’t forget this useful tip.
$array_new = array_filter($array_with_empty_elements);
via The Storyteller
Posted at 11:40, September 2 2009
php 5.3 $_REQUEST + sessions/cookie
Came across this today, where login was working on 2 developer machines but not on someone else’s.
The code was the latest checkout from svn. Much headscratching as the $_SESSION variables were set, but $_REQUEST didn’t contain some expected values.
More headscratching followed by chin scratching found that the machine that wasn’t working was running php 5.3 rather than 5.2.x.
Turns out $_COOKIE isn’t included in $_REQUEST by php 5.3. This can be changed using the variables_order so you can specify the order in which superglobals are loaded into $_REQUEST - More info