Php Not Working In

Problems with the Mac OS X version of XAMPP, questions, comments, and anything related.

Php Not Working In

Postby Krishna12345 » 27. May 2016 16:07

Hi ,
Im new to PHP , im using MAC and im running XAMPP 5.6.2.10, it was working properly, later i created a new folder in "htdocs" by name " test " upto this everything is okay but problem is that when ever i try to execute any small program it was not getting executed here is my program
<body>
<font size=“6” color=“yellow”>
<?php
$books=array(“HTML”,”CSS”,”JS”,”PHP”,”WORDPRESS”,”XML”);
echo “<pre>”;
print_r($books);
echo”</pre>”;
?>
</font>
</body>



when i try to execute it it was displaying an error like " Parse error: syntax error, unexpected '>' in /Applications/XAMPP/xamppfiles/htdocs/test/na.php on line 5 "

please help me on this
Krishna12345
 
Posts: 2
Joined: 27. May 2016 15:56
XAMPP version: 5.2.61
Operating System: MAC

Re: Php Not Working In

Postby Nobbie » 28. May 2016 10:39

You are using the wrong quote characters (i think this a typical OSX issue, i dont have these quotes on my keyboard neither in my editor).

Youre quote character looks so:

Code: Select all
echo “<pre>”;


but the correct one is this:

Code: Select all
echo "<pre>";


If unsure, use screen magnification to see the difference. Also this is only one example, ALL OF YOUR QUOTES ARE WRONG!

You also missed a space one the second echo command:

Code: Select all
echo”</pre>”;


Insert a space after echo.
Nobbie
 
Posts: 13170
Joined: 09. March 2008 13:04

Re: Php Not Working In

Postby Krishna12345 » 28. May 2016 11:17

Thank You Very Much Nobble its working now as i just changed those two . i.e ftom " to "
Krishna12345
 
Posts: 2
Joined: 27. May 2016 15:56
XAMPP version: 5.2.61
Operating System: MAC


Return to XAMPP for macOS

Who is online

Users browsing this forum: No registered users and 16 guests