Jump to content

Echoed values to a string variable


swift1984m

Recommended Posts

 

Hi,

  I am trying to add a plugin to an existing system (i cannot change anything in existing system), and i can use the function defined in exsiting system.

 

now i write a program which uses this function from existing system. and this function echos some data as output.

I want to have all the echoed data from the function in a string variable in my program.

 

see the code snippet how right now i am calling the function $ps_product->show_snapshot. $ps_product->show_snapshot echos some data i want to store the echoed html to a variable $string. Please help me with this.

$string=""

foreach($rows as $row) {

if($count==0) $string=$string."<tr>";

else if($count%$pinrow==0) echo "</tr><tr>";

$string=$string. "<td>";

$ps_product->show_snapshot( $row->product_sku, $show_price, $show_addtocart ); $count++;

                $string=$string."</td>";

Link to comment
https://forums.phpfreaks.com/topic/110307-echoed-values-to-a-string-variable/
Share on other sites

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.