a***@coopedupcomputers.com
2008-10-03 18:01:17 UTC
When I execute this code:
<?php function get_string_between($string, $start, $end){
$string = " ".$string;
$ini = strpos($string,$start);
if ($ini == 0) return "";
$ini += strlen($start);
$len = strpos($string,$end,$ini) - $ini;
return substr($string,$ini,$len);
}
$fullstring = $row_getRecords['agent'];
$parsed = get_string_between($fullstring, ".", "@");
echo $parsed; ?>
I get this error:
Fatal error: Cannot redeclare get_string_between() (previously
declared in /home....
I have this function wrapped in a do while loop which I think is
causing my problem. I get one result, then the error message. I have
one call to another page, but set it up as include_once. Anyone know
what may be causing it? The $agent variable is an email address. I'm
trying to grab the last name of the agent with this function. If
anyone has another method to do this, I'd be willing to try!
Azo
<?php function get_string_between($string, $start, $end){
$string = " ".$string;
$ini = strpos($string,$start);
if ($ini == 0) return "";
$ini += strlen($start);
$len = strpos($string,$end,$ini) - $ini;
return substr($string,$ini,$len);
}
$fullstring = $row_getRecords['agent'];
$parsed = get_string_between($fullstring, ".", "@");
echo $parsed; ?>
I get this error:
Fatal error: Cannot redeclare get_string_between() (previously
declared in /home....
I have this function wrapped in a do while loop which I think is
causing my problem. I get one result, then the error message. I have
one call to another page, but set it up as include_once. Anyone know
what may be causing it? The $agent variable is an email address. I'm
trying to grab the last name of the agent with this function. If
anyone has another method to do this, I'd be willing to try!
Azo