Cannot redeclare clean_path() [SOLVED]

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
jmansa
Forum Commoner
Posts: 81
Joined: Wed Aug 23, 2006 4:00 am

Cannot redeclare clean_path() [SOLVED]

Post 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.'';
      }
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post by s.dot »

You're most likely declaring clean_path() in another part of your code.
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
jmansa
Forum Commoner
Posts: 81
Joined: Wed Aug 23, 2006 4:00 am

Post by jmansa »

Thanks... Found another record inside the script...
Post Reply