I have made a small multiplication function
<p><?php
$a= "<?php echo $this->prodDet->v_price?>";
$b=.26;
$c=$a*$b;
echo $c;
?>
Here the price value is extracted from database of the requiste product and is multiple by fixed .26 variable. Wondering why am getting this errror -
Catchable fatal error: Object of class stdClass could not be converted to string in
I am learning the basics of PHP. can someone suggest how to get it solved please?
Thanks


<?php ?>blocks. When you get to$a="<?php, you're already inside a<?phpblock from the first line (we've not seen a closing?>), so that's where things stop making sense. You're trying to set $a to the string<?php echo $this->prodDet->v_price?>, which is valid, but not what you want to do. As a side-effect it's trying to evaluate$thisas a string because you're using double-quotes.