str_replace() for a string

Hi

I have an admin panel where the admin puts certain information about a products details that tell the customer about the size dimensions. I want to get this data and place it on the products page in separate divs.

Additional info: 1.17mm 2.53mm 3.140mm

The admin uploads the data like that above. So “1.” and followed by a number for the measurement ending with mm

The first is height, width and length.

It echos like this


<?
$choc = $item->long_description_2;
echo $choc;
?>

Result “1.17mm 2.53mm 3.140mm”

I want it like:

<div class=“heightframe”>1.17mm</div><div class=“widthframe”>2.53mm</div><div class=“lengthframe”>3.140mm</div>

I am trying to use STR_Replace. I would normally use Classic ASP but my client has a PHP server so it is pretty new to me… not really new but pretty…

<?
$choc = $item->long_description_2;
echo str_replace(“1.”,"<div class=‘heightframe’>",“2.”,"</div><div class=‘widthframe’>",“3.”,"</div><div class=‘lengthframe’>",$choc);

//1.17mm 2.53mm 3.140mm

//echo str_replace(“world”,“Peter”,“Hello world!”);

?>

As you can see I am trying to say anything after “1.” or “2.” or “3.” end a div and replace with a div.