• warning: file_get_contents(http://wonkenstein.tumblr.com/api/read?num=50&start=0) [function.file-get-contents]: failed to open stream: HTTP request failed! HTTP/1.1 503 Service Temporarily Unavailable in /home/mwong1978/wonkenstein.com/public_html/sites/all/modules/wonkenstein/zendcache/zendcache.module on line 25.
  • warning: Invalid argument supplied for foreach() in /home/mwong1978/wonkenstein.com/public_html/sites/all/modules/wonkenstein/mytumblr/tumblr.module on line 174.

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

Tumblr Tags