Welcome! Log In Create A New Profile

Advanced

Arrays Help Plz

Posted by DesmondMpofu 
Announcements Last Post
Announcement myUnisa availability 21 to 24 March 2019 03/25/2019 12:25PM
Announcement SoC Curricula 09/30/2017 01:08PM
Announcement Demarcation or scoping of examinations and assessment 02/13/2017 07:59AM
Announcement School of Computing Short Learning Programmes 11/24/2014 08:37AM
Announcement Unisa contact information 07/28/2011 01:28PM
Arrays Help Plz
February 15, 2010 08:48AM
Language: PHP
<?php $flavor[] = “blue raspberry”; $flavor[] = “root beer”; $flavor[] = “pineapple”; sort($flavor); print_r($flavor); ?>

Can someone help me debugg the simple code above i get the following erroe msg: Parse error: syntax error, unexpected T_STRING in /Applications/XAMPP/xamppfiles/htdocs/array.php on line 2
avatar
Mac
Re: Arrays Help Plz
February 15, 2010 11:03AM
Only thing I can think of is that your quotation marks are curly - typically when you paste from Word.
Language: PHP
$flavor[] = "blue raspberry"; $flavor[] = "root beer"; $flavor[] = "pineapple"; sort($flavor); print_r($flavor);
Re: Arrays Help Plz
February 15, 2010 12:24PM
Thanx Mac, perfect, problem was with quotes... (I guess checking details is important)
avatar
Mac
Re: Arrays Help Plz
February 15, 2010 02:33PM
> Parse error: syntax error, unexpected T_STRING in /Applications/XAMPP/xamppfiles/htdocs/array.php on line 2
it says syntax error - so you know it is a missing ; or ' or " or maybe var instead of $var.
Re: Arrays Help Plz
February 15, 2010 03:05PM
And in my case the curly quotation mark instead of the normal ones....Thanx again, will keep that in mind when I encounter that error msg in future
Sorry, only registered users may post in this forum.

Click here to login