I just started learning PHP and I am using a book called PHP & MySQL in easy steps by Mike McGrath. I have managed to get to a point where I am wondering if it’s me, or this guys code that’s the problem. while doing a test with the code below, I am getting told on my localhost: Parse error : syntax error, unexpected ‘<’, expecting end of file in C:\Abyss Web Server\htdocs\sort.php on line 33
yet, when I run the code on PHP TESTER is comes up perfect. I am getting very frustrated with this. My testing server is Abyss and using PHP 7. Any ideas?
<?php # Statements to be inserted here. $cars = array( 'Dodge' => 'viper' , 'Chevrolet' => 'Camaro' , 'Ford' => 'Mustang' ) ; echo '- Original Element Order :
- ' ; foreach( $cars as $key => $value ) { echo ' • ' , $key . ' ' . $value ; } asort( $cars ) ; echo '
- Sorted Into Value Order :
- ' ; foreach( $cars as $key => $value ) { echo ' • ' , $key . ' ' . $value ; } ksort( $cars ) ; echo '
- Sorted Into Key Order :
- ' ; foreach( $cars as $key => $value ) { echo ' • ' , $key . ' ' . $value ; } echo '