Array
Perform a function on an array of items (105)
Date Published: November 07, 2009
 <?php 
$old 
= array('Block''inline');
$new array_map('strtoupper'$old);

 
// $new is now array('BLOCK', 'INLINE');
?>
         
Parse JSON Data (135)
Date Published: November 07, 2009
 <?php 
$json 
='{"id":1,"name":"foo","interest":["wordpress","php"]} ';  
$obj=json_decode($json); 
echo 
$obj->interest[1]; //prints php
?>
         
Simple Array (111)
Date Published: October 20, 2009
 <?php
$x
=array(1=>"one","two","three");
foreach (
$x as $key => $val)
  {
  echo 
$key "=>" $val "<br />";
  }
?> 
Fast Letter Wheel (89)
Date Published: October 20, 2009
 <?php
foreach (range('a''z') as $char) {
  print 
'<a href="#' $char '">' 
  
$char '</a> | ';
}
?> 
Check if value is in array and returns Yes or No (126)
Date Published: October 20, 2009
 <?php
$names 
= array( 'Bob''Jim''Mark' );
echo 
'In Array?';
if (
in_array(‘foo’$names)) 
 
    echo 
'Yes'

else 
    echo 
'No'
?> 
Find File Extension [CSS-TRICKS.COM](94)
Date Published: October 20, 2009
 <?php
$filename 
'mypic.gif';
$ext pathinfo($filename
PATHINFO_EXTENSION);
echo 
"." $ext;
?>