MDanz Posted May 21, 2010 Share Posted May 21, 2010 i'm trying to echo a variable for padding. $finalposition is an integer. echo "style='padding-top:$finalpositionpx"; i got it working when i put php tags around the variable but that messes up my whole code. it's because of the px. i think php is reading the variable as $finalpositionpx rather than $finalposition. what can i do? Quote Link to comment Share on other sites More sharing options...
Jax2 Posted May 21, 2010 Share Posted May 21, 2010 echo "style='padding-top:' ".$finalposition." px"; Quote Link to comment Share on other sites More sharing options...
kenrbnsn Posted May 21, 2010 Share Posted May 21, 2010 You could also do <?php echo "style='padding-top:{$finalposition}px"; ?> Ken Quote Link to comment Share on other sites More sharing options...
pengu Posted May 21, 2010 Share Posted May 21, 2010 Crud.. didn't realise it was solved.. sorry! 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.