How can I take a string of numbers ($num = "3724"😉 and split each number so each of them equals a value? example: $a = "3"; $b = "7"; $c = "2"; d = "4"; or if the string is $num = "43"; then $a = "4"; $b = "3";
$num = "3724"; for($i=0; $i < strlen($num); $i++) { $varname = chr($i + 97); $$varname = substr($num,$i,1); }
Hope this helps...
Boris Belobrad Belcom Bailey LLC www.belcombailey.com
I'm kinda new to PHP so how would I get it to display each variable?
$num = "3724"; for($i=0; $i < strlen($num); $i++) { $varname = chr($i + 97); $$varname = substr($num,$i,1); print "$".$varname."=".$$varname . "<br>"; }
Hey cool, thanks a lot!