parse error

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
jonspeedr
Forum Newbie
Posts: 2
Joined: Wed Nov 24, 2004 9:18 pm
Location: carrollton ga
Contact:

parse error

Post 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]
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Re: parse error

Post 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
jonspeedr
Forum Newbie
Posts: 2
Joined: Wed Nov 24, 2004 9:18 pm
Location: carrollton ga
Contact:

parse error

Post 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
User avatar
patrikG
DevNet Master
Posts: 4235
Joined: Thu Aug 15, 2002 5:53 am
Location: Sussex, UK

Post 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.
Post Reply