Page 1 of 1

parse error

Posted: Wed Nov 24, 2004 9:23 pm
by jonspeedr
:?: :?: :?:
im looking for help, i have typed this php code and it doesnt work. I receive a parse error everytime i run it and it will not execute any further....

Parse error: parse error in c:\phpdev\www\kitties.php on line 4

heres the code...

<?php
$money = 30;
$pet = “Kitten”;
$new = sprintf(“It costs $%03.2f for a %s.\n”,$money,$pet);
$new2 = sprintf(“%’.-20s%3.2f”,$pet,$money);
echo $new;
echo $new2;
?> :?: :?: :?: [php_man][/php_man]

Re: parse error

Posted: Wed Nov 24, 2004 9:31 pm
by John Cartwright
jonspeedr wrote::?: :?: :?:
im looking for help, i have typed this php code and it doesnt work. I receive a parse error everytime i run it and it will not execute any further....

Parse error: parse error in c:\phpdev\www\kitties.php on line 4

heres the code...

<?php
$money = 30;
$pet = “Kitten”;
$new = sprintf(“It costs $%03.2f for a %s.\n”,$money,$pet);
$new2 = sprintf(“%’.-20s%3.2f”,$pet,$money);
echo $new;
echo $new2;
?> :?: :?: :?: [php_man][/php_man]
your answer can be found at viewtopic.php?t=8815

parse error

Posted: Wed Nov 24, 2004 9:38 pm
by jonspeedr
Hey! i figured it out. i retyped it exactly the say w/ nothing different in the script and it worked... has anyone experienced scripts that wont work if they are copied and pasted into the editor(windows notepad)? maybe it was the font i used.?!?

8O

Posted: Thu Nov 25, 2004 3:29 am
by patrikG
jonspeedr: please make sure that you're posting in the appropriate forum. I've split the thread from Site News - "Help us improve the forum" and moved it to "PHP Code" which is where your question belongs.