Cannot redeclare clean_path() [SOLVED]
Posted: Tue Sep 18, 2007 1:29 pm
How come I get this message when trying to call on script twice on same page? How do I get past this?
Code: Select all
if( isset( $row['image'] ) && isset( $row['url'] ) )
{
function clean_path($path) {
return preg_replace(array('~\\\+~', '~/{2,}~'), '/', $path);
}
$s = '\\\s\/fg////fgf//fg\\dfg/dgd\d/gd\//\/dg\\\fg\\\gf';
$s = clean_path($s);
$image = 'uploads/' . clean_path($row['image']);
if( $row['image'][0] != '/' )
{
//$image .= DIRECTORY_SEPARATOR;
}
$bannerlink = $row['url'];
print '", "'.$image.'");';
print 'holder.addVariable("imagelink", "'.$bannerlink.'';
}