Page 1 of 1

Cannot redeclare clean_path() [SOLVED]

Posted: Tue Sep 18, 2007 1:29 pm
by jmansa
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.'';
      }

Posted: Tue Sep 18, 2007 1:47 pm
by s.dot
You're most likely declaring clean_path() in another part of your code.

Posted: Tue Sep 18, 2007 2:00 pm
by jmansa
Thanks... Found another record inside the script...