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

Link to comment
Share on other sites

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>";
?>

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.