本文整理汇总了PHP中clsTinyButStrong::f_Loc_PrmCompute方法的典型用法代码示例。如果您正苦于以下问题:PHP clsTinyButStrong::f_Loc_PrmCompute方法的具体用法?PHP clsTinyButStrong::f_Loc_PrmCompute怎么用?PHP clsTinyButStrong::f_Loc_PrmCompute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类clsTinyButStrong
的用法示例。
在下文中一共展示了clsTinyButStrong::f_Loc_PrmCompute方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: f_Loc_PrmRead
static function f_Loc_PrmRead(&$Txt, $Pos, $XmlTag, $DelimChrs, $BegStr, $EndStr, &$Loc, &$PosEnd, $WithPos = false)
{
$BegLen = strlen($BegStr);
$BegChr = $BegStr[0];
$BegIs1 = $BegLen === 1;
$DelimIdx = false;
$DelimCnt = 0;
$DelimChr = '';
$BegCnt = 0;
$SubName = $Loc->SubOk;
$Status = 0;
// 0: name not started, 1: name started, 2: name ended, 3: equal found, 4: value started
$PosName = 0;
$PosNend = 0;
$PosVal = 0;
// Variables for checking the loop
$PosEnd = strpos($Txt, $EndStr, $Pos);
if ($PosEnd === false) {
return;
}
$Continue = $Pos < $PosEnd;
while ($Continue) {
$Chr = $Txt[$Pos];
if ($DelimIdx) {
// Reading in the string
if ($Chr === $DelimChr) {
// Quote found
if ($Chr === $Txt[$Pos + 1]) {
// Double Quote => the string continue with un-double the quote
$Pos++;
} else {
// Simple Quote => end of string
$DelimIdx = false;
}
}
} else {
// Reading outside the string
if ($BegCnt === 0) {
// Analyzing parameters
$CheckChr = false;
if ($Chr === ' ' or $Chr === "\r" or $Chr === "\n") {
if ($Status === 1) {
if ($SubName and $XmlTag === false) {
// Accept spaces in TBS subname.
} else {
$Status = 2;
$PosNend = $Pos;
}
} elseif ($XmlTag and $Status === 4) {
clsTinyButStrong::f_Loc_PrmCompute($Txt, $Loc, $SubName, $Status, $XmlTag, $DelimChr, $DelimCnt, $PosName, $PosNend, $PosVal, $Pos, $WithPos);
$Status = 0;
}
} elseif ($XmlTag === false and $Chr === ';') {
clsTinyButStrong::f_Loc_PrmCompute($Txt, $Loc, $SubName, $Status, $XmlTag, $DelimChr, $DelimCnt, $PosName, $PosNend, $PosVal, $Pos, $WithPos);
$Status = 0;
} elseif ($Status === 4) {
$CheckChr = true;
} elseif ($Status === 3) {
$Status = 4;
$DelimCnt = 0;
$PosVal = $Pos;
$CheckChr = true;
} elseif ($Status === 2) {
if ($Chr === '=') {
$Status = 3;
} elseif ($XmlTag) {
clsTinyButStrong::f_Loc_PrmCompute($Txt, $Loc, $SubName, $Status, $XmlTag, $DelimChr, $DelimCnt, $PosName, $PosNend, $PosVal, $Pos, $WithPos);
$Status = 1;
$PosName = $Pos;
$CheckChr = true;
} else {
$Status = 4;
$DelimCnt = 0;
$PosVal = $Pos;
$CheckChr = true;
}
} elseif ($Status === 1) {
if ($Chr === '=') {
$Status = 3;
$PosNend = $Pos;
} else {
$CheckChr = true;
}
} else {
$Status = 1;
$PosName = $Pos;
$CheckChr = true;
}
if ($CheckChr) {
$DelimIdx = strpos($DelimChrs, $Chr);
if ($DelimIdx === false) {
if ($Chr === $BegChr) {
if ($BegIs1) {
$BegCnt++;
} elseif (substr($Txt, $Pos, $BegLen) === $BegStr) {
$BegCnt++;
}
}
} else {
$DelimChr = $DelimChrs[$DelimIdx];
//.........这里部分代码省略.........