$query1 = mysqli_query($cone,"SELECT words FROM banlist ORDER BY words") or die(mysql_error());
while($row = mysqli_fetch_array($query1, MYSQLI_ASSOC)) {
$fix = (string)$row['words'];
$title = str_replace($fix, "-", $title);
}
echo $title;
var_dump($row)
's output:
array(1) {
["words"]=> string(5) "hello "
}
array(1) {
["words"]=> string(5) "you "
}
It doesn't replace any string in the title But if I put the values directly like "hello"
in the place of $fix
then it works fine.