0
HI我正在修改MyBB的源代碼。PHP preg_replace:下面的代碼是做什麼的?
下面的代碼是從class_feedgeneration.php
:
/**
* Sanitize content suitable for RSS feeds.
*
* @param string The string we wish to sanitize.
* @return string The cleaned string.
*/
function sanitize_content($content)
{
$content = preg_replace("#&[^\s]([^\#])(?![a-z1-4]{1,10};)#i", "&$1", $content);
$content = str_replace("]]>", "]]]]><![CDATA[>", $content);
return $content;
}
一日一:
$content = preg_replace("#&[^\s]([^\#])(?![a-z1-4]{1,10};)#i", "&$1", $content);
它有什麼作用是什麼呢?我知道一點正則表達式,但這個有點太複雜。
有人可以向我解釋這一點嗎?
非常感謝!