我不知道这里的概率是什么!我从这个函数中得到一个错误preg_replace?
function remove_wp_width_height($string){
return preg_replace('/\/i', "",$string);
}
echo remove_wp_width_height(get_the_post_thumbnail($post->ID,'large'));
错误:
Warning: preg_replace(): No ending delimiter '/' found in /var/www/wp332/wp-content/plugins/mashable_menu/index.php on line 272
我尝试调整WordPress的图像
感谢高级
请笑w示例输入和输出字符串。如果你想要做的只是从字符串中去掉反斜杠(看起来是这样),不需要正则表达式 - 一个简单的'str_replace('\\','',$ string);'会做。 – DaveRandom
您需要在正则表达式中跳过反斜杠:''/ \\/i'' –