BBCode::Internal_CleanupWSByIteratingPointer( $pattern,  $pos,  $array )

Description

Source

File: bp-forums/admin/parser.php

function Internal_CleanupWSByIteratingPointer($pattern, $pos, $array) {
if (strlen($pattern) <= 0) return $pos;
foreach (str_split($pattern) as $char) {
switch ($char) {
case 's':
while ($pos < count($array) && $array[$pos][BBCODE_STACK_TOKEN] == BBCODE_WS)
$pos++;
break;
case 'n':
if ($pos < count($array) && $array[$pos][BBCODE_STACK_TOKEN] == BBCODE_NL)
$pos++;
break;
case 'a':
while ($pos < count($array)
&& (($token = $array[$pos][BBCODE_STACK_TOKEN]) == BBCODE_WS || $token == BBCODE_NL))
$pos++;
break;
}
}
return $pos;
}

Questions?

We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.