阅读背景:

如何从SQL中提取西里尔数据作为数组并使用str_replace()

来源:互联网 

I have the code:

我有代码:

mysql_connect('...');
mysql_select_db('...');
$result = mysql_query('SELECT `oldword`, `newword` FROM `#_words`');
$find = array();
$replace = array();
while ($row = mysql_fetch_assoc($result)) {
 $find[] = $row['oldword'];
 $replace[] = $row['newword'];
}
$oldstring = 'Some text';
$newstring = str_replace($find, $replace, $oldstring);
echo $newstring;
mysql_connect('...')



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: