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!
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
It is me again
I can't understand what is wrong with this php script. Pleaz help me.
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
I get this.............. Parse error: parse error, unexpected T_VARIABLE, expecting ',' or ';' in C:\Program Files\DzSoft\PHP Editor\php26.tmp on line 15
tsalexey544 wrote:I get this.............. Parse error: parse error, unexpected T_VARIABLE, expecting ',' or ';' in C:\Program Files\DzSoft\PHP Editor\php26.tmp on line 15
That's the error I was getting too, and then I added the dots, the code I posted as a reply worked for me.
<?php
$tseitlin = array(
"Alex" => array("18","Tennis"),
"Daniel" => array("14", "basketball"),
);
echo "Alexey is " . $tseitlin['Alex'][0] . " years old. And he likes to play" . $tseitlin['Alex'][1] . ;
echo "My brother is " . $tseitlin['Daniel'][0] . " years old. And he likes to play" . $tseitlin['Daniel'][1] . ;
?>
echo "Alexey is " . $tseitlin['Alex'][0] . " years old. And he likes to play" . $tseitlin['Alex'][1] . ;
echo "My brother is " . $tseitlin['Daniel'][0] . " years old. And he likes to play" . $tseitlin['Daniel'][1] . ;
echo "Alexey is " . $tseitlin['Alex'][0] . " years old. And he likes to play" $tseitlin['Alex'][1];
echo "My brother is " . $tseitlin['Daniel'][0] . " years old. And he likes to play" $tseitlin['Daniel'][1];
echo "Alexey is " . $tseitlin['Alex'][0] . " years old. And he likes to play" . $tseitlin['Alex'][1];
echo "My brother is " . $tseitlin['Daniel'][0] . " years old. And he likes to play" . $tseitlin['Daniel'][1];