Re: parse error: [PHP] usort e & é toge ther

From: Date: Mon, 12 Jul 2004 02:13:08 +0000
Subject: Re: parse error: [PHP] usort e & é toge ther
References: 1 2 3 4 5  Groups: php.general 
Request: Send a blank email to php-general+get-190209@lists.php.net to get a copy of this message
Dunno the original question, but this obviously should be escaped... So the correct code follows... usort($authors, create_function('$a,$b','
      $a = str_replace(array(\'é\', \'a\'), array(\'e\', \'a\'), $a);
      $b = str_replace(array(\'é\', \'a\'), array(\'e\', \'a\'), $b);
      return strcasecmp($a,$b);'));
Regards, m. John Taylor-Johnston wrote:
Sorry. Still getting a parse error on line 40: 39> usort($authors, create_function('$a,$b','
40>          $a = str_replace(array('é', 'à'), array('e', 'a'), $a);
41>          $b = str_replace(array('é', 'à'), array('e', 'a'), $b);
42>          return strcasecmp($a,$b);'));
Can you have two arrays there? http://ca2.php.net/manual/en/function.str-replace.php All the brackets are in the right place. Hmmm ...? Thanks, John


« previous php.general (#190209) next »