Returning a string from a function
| From: | Richard Kurth | Date: | Tue, 21 Aug 2001 09:36:36 +0000 |
| Subject: | Returning a string from a function | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-63661@lists.php.net to get a copy of this message | ||
Could somebody tell me way this function will not work I know the
script inside the function works because I have tested it but when I
put it in a function all I get back when I call it is a 1
function &getpath($search) {
Global $search,$path;
$a =
/bin/ls -al /home/sites/ | awk {'print $9" "$10" "$11"
"'} | grep $search;
$items = explode ("www.", $a);
For($i = 0; $i< (count($items)/1); $i +=1){
$path=strstr(($items[$i]), '/');
return $path;
}
}
$path=&getpath($search);
Best regards,
Richard
mailto:rkurth@pacifier.com