输入banner图图片脚本导航/分类

在线急求php的一个问题感谢!

function number($str)
{
preg_replace('/\D/s', '', $str);

} echo number('文字蚊子38');

提取出来的数字 $asd = preg_replace('/\D/s', '', $str); 获取不到啊


回复讨论(解决方案)

急求~~~ 好心人来帮帮忙啊

因为你的函数没有返回值。

function number($str)
{
return preg_replace('/\D/s', '', $str);
}

function number($str)
{
return preg_replace('/\D/s', '', $str);
}



亲爱的版主 我这个样子了 输出的是数字38 怎么能让 $asd = 38 ?

函数没有返回值

function number($str)
{
return preg_replace('/\D/s', '', $str);
}

亲爱的版主 我这个样子了 输出的是数字38 怎么能让 $asd = 38 ? 就是$asd得到输出后的数字?

函数没有返回值



能给下具体操作吗? return preg_replace('/\D/s', '', $str); 后我的到了数字 但怎么能让 $asd = 38 ? 就是$asd得到输出后的数字?

function number($str)
{
return preg_replace('/\D/s', '', $str);

}
$asd = number('文字蚊子38');
echo $asd;

function number($str)
{
return preg_replace('/\D/s', '', $str);

}
$asd = number('文字蚊子38');
echo $asd;

正解 感谢!!!!!!!