xyn Posted November 27, 2006 Share Posted November 27, 2006 Hey,I have a language filter, which returns "Array"I'm not sure why :Smy code...function FilterWords($w1){ $sql = mysql_query("SELECT * FROM filter"); $words = array(); $replace = array(); while ($x = mysql_fetch_array($sql)) { $words[] = $x['badword']; $replace[] = $x['replace']; } $return['1'] = str_replace($words, $replace, $w1); return $return;}I use this... INSERT INTO table (*fields*) VALUES ('".FilterWords($_POST[field])."') Link to comment https://forums.phpfreaks.com/topic/28669-array/ Share on other sites More sharing options...
kenrbnsn Posted November 27, 2006 Share Posted November 27, 2006 It's returning an array because you made the variable $return an array. Remove the "['1']" from the variable assignment.Ken Link to comment https://forums.phpfreaks.com/topic/28669-array/#findComment-131185 Share on other sites More sharing options...
xyn Posted November 27, 2006 Author Share Posted November 27, 2006 oh, yeh i thought that.Thanks! Link to comment https://forums.phpfreaks.com/topic/28669-array/#findComment-131190 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.