Friday, May 14, 2010

Get Last Value using PHP explode

 $hostname = "http://localhost/test/123.jpg";
                                 $expname = explode ("/", $hostname);
                                 // Point to the last element of array
                                 $lastV =  end($expname);
                                 // Get the current element of array
                               $lastV =  pos($expname);

1 comment:

 

Followers