Hi there,
To be honest, i'm a bit confiused at your post weedpacket, however i have been trying to get it working again, with no sucess still!!
Just wondering if you can look at my code and see if you can point anything out -
<?php
$str_rep = "SELECT * FROM `smilies`";
$str_rep_result = mysql_query($str_rep, $db) or die ("Couldn't execute query");
$output = nl2br(htmlentities($post_vars[message]));
while ($str_rep_row = mysql_fetch_array($str_rep_result)){
$output = str_replace($str_rep_row["original"], $str_rep_row["change_to"], $output);
}
echo $output;
?>
I have been experiementing with the following i found in the PHP manual:
$newstring = preg_replace("/Old/i", "New", "OLd string.");
This works great just using text like above, but when i try and combine it with variables within the loop it still doesnt work 🙁
e.g:
$output = preg_replace("/$str_rep_row['original']/i", $str_rep_row['change_to'], $output);
Thanks for all the help!!
Jonathan