wordpressで非常に奇妙な問題が発生しています。
投稿コンテンツを変数として取得し、結果なしで変数に対して preg_match を実行します。次に、変数自体の代わりに変数である文字列を使用すると、すべてが完璧に機能します。これは私を狂わせています。誰か助けてくれませんか?
// This doesn't work, I checked a thousand times and inside the $content variable
// is the same string as I use below
$content = the_content();
preg_match('/<iframe.*src=\\"(.*)\\".*><\\/iframe>/is', $content, $matches);
return $matches;
// This works perfect?
$content = the_content();
preg_match('/<iframe.*src=\\"(.*)\\".*><\\/iframe>/is', "this is a string containing <iframe ...", $matches);
return $matches;