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? Quote Link to comment 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] Quote Link to comment Share on other sites More sharing options...
superhoops Posted August 30, 2006 Author Share Posted August 30, 2006 Thanks. Quote Link to comment 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] Quote Link to comment 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] Quote Link to comment Share on other sites More sharing options...
superhoops Posted August 30, 2006 Author Share Posted August 30, 2006 Thanks. 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.