inc_file('$2')", $compileContent); inc_file('$2') は文字列として置き換えられます。 $t の使用方法。"/> inc_file('$2')", $compileContent); inc_file('$2') は文字列として置き換えられます。 $t の使用方法。">

ホームページ  >  記事  >  バックエンド開発  >  定期交換に関する課題

定期交換に関する課題

WBOY
WBOYオリジナル
2016-06-13 13:44:39922ブラウズ

通常の置換問題
$compileContent = preg_replace("/({cm:)includes*(.+)(})/i", "$this->inc_file('$2')", $compileContent);

$this->inc_file('$2') は文字列として置き換えられます

$this->
によって返された結果に置き換える方法
------解決策---------

$compileContent = preg_replace("/({cm:)includes*(.+)(})/ie", "$this->inc_file('$2')", $compileContent);
声明:
この記事の内容はネチズンが自主的に寄稿したものであり、著作権は原著者に帰属します。このサイトは、それに相当する法的責任を負いません。盗作または侵害の疑いのあるコンテンツを見つけた場合は、admin@php.cn までご連絡ください。