note 20090 modified in control-structures.switch by vrana

From: Date: Tue, 17 Aug 2004 13:54:57 +0000
Subject: note 20090 modified in control-structures.switch by vrana
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-79803@lists.php.net to get a copy of this message
To get the conditional statement to work for the above example use this: <?php $chr = substr($a,$i,1); switch (TRUE) { case $chr == "á" || $chr == "à" || $chr == "ã" || $chr == "â": $a = str_replace(substr($a,$i,1),"a",$a); break; case $chr == "é" || $chr == "è" || $chr == "ê": $a = str_replace(substr($a,$i,1),"e",$a); break; ?> } --was-- To get the conditional statement to work for the above example use this: $chr = substr($a,$i,1); switch (TRUE) { case $chr == "á" || $chr == "à" || $chr == "ã" || $chr == "â": $a = str_replace(substr($a,$i,1),"a",$a); break; case $chr == "é" || $chr == "è" || $chr == "ê": $a = str_replace(substr($a,$i,1),"e",$a); break; } http://php.net/manual/en/control-structures.switch.php

« previous php.notes (#79803) next »