Whats is the difference between [] and {} ?
define(NL,"<br>\n");
$str="How do you do?";
echo $str[3].NL;
echo $str{3}.NL;
$array = array("how","do","you","do?");
echo $array[2].NL;
echo $array{2}.NL;
this outputs
d
d
you
you
so there's no difference right? When does a string become an array and
vice-versa?
if I do $str=(array)$str; then $str[0] will contain "How do you do?" but if
I do $array=(string)$array then $array contains the string "Array", so it
doesn't work both ways. How does PHP works with this? I come from C where a
string and an array of char is exactly the same thing, so this kinda
confuses me.
____________________________
. Christian Dechery (lemming)
. http://www.tanamesa.com.br
. Gaita-L Owner / Web Developer
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]