Page 1 of 1

printf()

Posted: Wed Jul 20, 2011 10:22 am
by niche1
I have this code that displays properly:

Code: Select all

printf("<p style=\"font-size:9px;margin:0px;\"> <span style=\"background-color:yellow\">Expires %s. </span></p>",$expdat); 
Now, I need to turn the code between in <span> in to a variable with a variable.

How do I code for the second variable in printf() when?:
$dclaim = <span style=\"background-color:yellow\">Expires' . $expdat . '.</span>
Edit/Delete Message

Re: printf()

Posted: Thu Jul 21, 2011 9:37 am
by social_experiment

Code: Select all

<?php
 $expdat = 'Tomorrow';
 $dclaim = "<span style=\"background-color:yellow\">Expires " . $expdat . ".</span>"; 
 printf("<p style=\"font-size:9px;margin:0px;\"> $dclaim </p>", $dclaim);  
?>