使用
this function
原文链接:https://www.f2er.com/php/137643.html$code = '[include file="header.html"]'; $innerCode = GetBetween($code,'[',']'); $innerCodeParts = explode(' ',$innerCode); $command = $innerCodeParts[0]; $attributeAndValue = $innerCodeParts[1]; $attributeParts = explode('=',$attributeParts); $attribute = $attributeParts[0]; $attributeValue = str_replace('\"','',$attributeParts[1]); echo $command . ' ' . $attribute . '=' . $attributeValue; //this will result in include file=header.html
$command将是“include”
$attributeValue将是“header.html”