Forum Moderators: coopster

Message Too Old, No Replies

your favourite undocumented, or under-documented features

built-in functions you never knew existed

         

httpwebwitch

5:21 pm on May 20, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



In another thread, I was enlightened by someone mentioning "glob()". Until then, I was using a 3-page-long script to accomplish what glob() does in just one simple command.

Like most developers, I'm learning PHP from printed manuals, online tutorials, experiments, and advice in this forum. When I need syntax clarification, I go to PHP.net. I have never encountered glob() until today.

My question is: what other features are hiding in the function list that we may not know about? Have you ever had a similar epiphany? What is your favourite "hidden gem" that goes unmentioned in the printed manuals like O'Reilly, Wrox, and the IDG Bible?

Some that I remember from my first few months of learning PHP were:

isset($var)
// myriad uses, inlcuding a "falseness" check for
// unchecked checkboxes

print_r($array)
// fantastic for debugging

foreach($array as $k=>$v)
// no more nasty $i increments and
// count($array) in my "for" loops

cal_days_in_month()
// it's about time

strtotime($string)
// excellent for weird date input from
// uncontrolled sources

getimagesize($filename)
// simply fantastic.

jatar_k

9:36 pm on May 20, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



apache_note
[ca.php.net...]

needed to do some tracking and pass vars to my apache logs from the SESSION

I read through the function list whenever I have some free time, I also try to read all the changelogs for new releases to see the added functions

<added>actually when I started using curl for various things it is pretty powerful and entertaining stuff
[ca.php.net...]

Timotheos

10:21 pm on May 20, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I though eval() was pretty cool when somebody first pointed it out to me all though I've never found a use for it ... yet.

jatar_k

10:35 pm on May 20, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



[ca.php.net...]
and
[ca.php.net...]

always seemed interesting but I have never really used them just fooled around a bit