superhoops Posted August 30, 2006 Share Posted August 30, 2006 Here is the code for my test page:[code]<?php$week = "3";echo 'There are currently 10-$week weeks left before it is built.';?>[/code]But it displays this [b]There is currently 10-$week weeks left before it is built[/b]Im a newbie and ive been p;layiong around with it but what i want to do it get it to work out 10 minus 3 ($week). What code do i need to do that? Link to comment https://forums.phpfreaks.com/topic/19116-quick-question/ Share on other sites More sharing options...
joking Posted August 30, 2006 Share Posted August 30, 2006 Hi,[code]<?php$week = "3";$val = 10 - $week;echo 'There are currently: ".$val." weeks left before it is built.';?>[/code] Link to comment https://forums.phpfreaks.com/topic/19116-quick-question/#findComment-82687 Share on other sites More sharing options...
superhoops Posted August 30, 2006 Author Share Posted August 30, 2006 Thanks. Link to comment https://forums.phpfreaks.com/topic/19116-quick-question/#findComment-82688 Share on other sites More sharing options...
superhoops Posted August 30, 2006 Author Share Posted August 30, 2006 For some reason with this code:[code]<?php$week = "3";$val = 10 - $week;echo 'There are currently ".$val." weeks left before it is built.';?>[/code]It only says this:[b]There are currently ".$val." weeks left before it is built.[/b] Link to comment https://forums.phpfreaks.com/topic/19116-quick-question/#findComment-82691 Share on other sites More sharing options...
joking Posted August 30, 2006 Share Posted August 30, 2006 I m sorry i didnt pay attention to your ' .you should use ' instead of " [code]<?php$week = "3";$val = 10 - $week;echo 'There are currently '.$val.' weeks left before it is built.';?>[/code] Link to comment https://forums.phpfreaks.com/topic/19116-quick-question/#findComment-82692 Share on other sites More sharing options...
superhoops Posted August 30, 2006 Author Share Posted August 30, 2006 Thanks. Link to comment https://forums.phpfreaks.com/topic/19116-quick-question/#findComment-82725 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.