Hello,
I want to know how to echo a string that have a $ sign from a database. At this time, the value on database 'Buy one for $5.00' converts to 'Buy one for .00'.
Let's say the name of the field is title
and the value is Buy one for $5.00
<?php
$body_tpl = file_get_contents('tpl.html'); //Title is: %title% blah blah %title%
$row = mysql_fetch_array(mysql_query("SELECT title FROM table WHERE id=1"));
$title = $row['title'];
$pat[] = '/%title%/sx';
$rep[] = $title;
$body = preg_replace($pat,$rep,$body_tpl);
print_r($body);
?>
Thank you, pnm123