Making anonymous functions from PHP 5.3 work with PHP 5.2

余生颓废 提交于 2019-12-02 12:07:59

preg_replace_callback() as a second argument requires a callable, that is a function itself, not a returned value from a function.

So just replace, upper_case($input) with upper_case, so it would look like this

preg_replace_callback('/([.!?])\s*(\w)/', 'upper_case', ucfirst(strtolower($input)));
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!