【问题标题】:callback function for php preg_replace_callback not getting called on linux CentOS 5.4php preg_replace_callback 的回调函数未在 linux CentOS 5.4 上被调用
【发布时间】:2010-06-08 15:07:34
【问题描述】:

我使用 preg_replace_callback 作为

$string = preg_replace_callback($pattern,'CreateTemplatesController::callbackhandler',$string);

我已经用类名调用了回调处理函数,因为这个函数是一个私有静态函数。

问题是“callbackhandler”函数没有被调用。

如果有人知道相同的原因,请发布。提前致谢

【问题讨论】:

    标签: function callback


    【解决方案1】:

    根据http://www.php.net/manual/en/language.pseudo-types.php#language.types.callback

    应该是array('CreateTemplatesController', 'callbackhandler')

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-09-02
      • 2014-05-24
      • 1970-01-01
      • 1970-01-01
      • 2012-12-14
      • 2020-10-31
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多