Jump to content

assign a whole html output to string variable


kannu

Recommended Posts

hey guys,

i have a html output which comprises of various variables where there values change on user selection, and their combined result together is output in html as a string

 

the following is the code

<td><span id="custom_carat"><?=$row_prod['total_carat_weight']?></span> Carat <span id="center_diamond1"><? echo $default_diamond['shape']; ?></span> <?=substr(substr(stripslashes($row_prod['product_name']),11),0,-14) ?><span id="custom_gold1"><?=$default_gold['text']?></span>  Gold </td>

 

Is it possible that I can assign the entire output of the above to a php variable.

 

if you can please let me know

 

thanks

this should work

<?php
$test = "<td><span id=\"custom_carat\">".$row_prod['total_carat_weight']."</span> Carat <span id=\"center_diamond1\">".$default_diamond['shape']."</span>". substr(substr(stripslashes($row_prod['product_name']),11),0,-14) ."<span id=\"custom_gold1\">".$default_gold['text']."</span>  Gold </td>";
?>

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.