gpt4 book ai didi

PHP从MySQL替换表情符号无法循环

转载 作者:行者123 更新时间:2023-11-28 23:57:10 25 4
gpt4 key购买 nike

我的表情符号语法编码有问题。第一篇文章也可以替换,下一篇文章就不能替换了。它也没有循环。

您可以在以下位置看到图片:

http://postimg.org/image/srph22j8d/

# POPULATED EMOTICON
$sqlEMO = "SELECT * FROM apprtcfg WHERE obj_typ = 'EMO' ORDER BY id ASC;";
$queryEMO = mysql_query($sqlEMO);

while ($rsltEmo=mysql_fetch_array($queryEMO)) {

$emo_code = $rsltEmo['obj_link'];
$emo_img = $rsltEmo['obj_source'];
}

echo $content = str_replace($emo_code,'<img src="image/'.$emo_img.'">', $row['content']);

最佳答案

你应该用图像代替你的情绪,在 while 内,并在 while 结束后回应它。

$sqlEMO = "SELECT * FROM apprtcfg WHERE obj_typ = 'EMO' ORDER BY id ASC;";
$queryEMO = mysql_query($sqlEMO);

$content = $row['content'];
while ($rsltEmo=mysql_fetch_array($queryEMO)) {

$emo_code = $rsltEmo['obj_link'];
$emo_img = $rsltEmo['obj_source'];
$content = str_replace($emo_code,'<img src="image/'.$emo_img.'">', $content);
}

echo $content;

关于PHP从MySQL替换表情符号无法循环,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31354126/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com