Switch to full style
:read: Start PHP with us. Includes topics to help you in php
Post a reply

Create function from string

Tue Oct 28, 2008 1:34 pm

Code:
<?
$lambda
=create_function('$a,$b','return(strlen($a)-strlen($b));');
$array = array('really long string here,boy', 'this', 'middling length',
               
'larger');
usort($array,$lambda);
print_r($array);

?>




Post a reply
  Related Posts  to : Create function from string
 Search in a string using FILTER function     -  
 recursive string reversal- reverse string     -  
 check if string ends with specific sub-string in php     -  
 check if string start with a specific sub-string in PHP     -  
 Splitting a String Based on a Found String     -  
 String token for string split     -  
 Pad a string to a certain length with another string     -  
 php function     -  
 Nested function     -  
 Using the array_slice () Function     -  

Topic Tags

PHP Functions