LiamProductions Posted July 7, 2007 Share Posted July 7, 2007 Hey. I have a problem. Im making a word reverser. And i get this error on the reversedword.php file: Parse error: syntax error, unexpected ';' in /home/liam/public_html/reversedword.php on line 12 Reversedword.php: <html> <head> <title>Word Reverser !!! </title> </head> <body bgcolor="black"> <font color="white"> <center> <?php $reverseword = isset($_POST['reverseword'])?$_POST['reverseword']:0; echo (strrev("$reverseword"); ?> </center> </font> </body> </html> Thanks Quote Link to comment Share on other sites More sharing options...
calabiyau Posted July 7, 2007 Share Posted July 7, 2007 <html> <head> <title>Word Reverser !!! </title> </head> <body bgcolor="black"> <font color="white"> <center> <?php $reverseword = isset($_POST['reverseword'])?$_POST['reverseword']:0; //change the line below to echo (strrev("$reverseword"); // echo strrev($reverseword); ?> </center> </font> </body> </html> Thanks Quote Link to comment Share on other sites More sharing options...
LiamProductions Posted July 7, 2007 Author Share Posted July 7, 2007 Many thanks, It works now. So when reversing a word you don't need the qoutes " ? Quote Link to comment Share on other sites More sharing options...
calabiyau Posted July 7, 2007 Share Posted July 7, 2007 You would only need the quotes if it were a literal string such as strrev('hellothere') but not if it is a variable, but your main problem was you had an extra ( before the function name that wasn't needed. Quote Link to comment Share on other sites More sharing options...
LiamProductions Posted July 7, 2007 Author Share Posted July 7, 2007 Oh ok, Thanks. Ill remember that. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.