本文整理汇总了PHP中_hx_substr函数的典型用法代码示例。如果您正苦于以下问题:PHP _hx_substr函数的具体用法?PHP _hx_substr怎么用?PHP _hx_substr使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了_hx_substr函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getPositionRepresentation
public function getPositionRepresentation()
{
$i0 = com_wiris_common_WInteger::min($this->i, $this->n);
$s0 = com_wiris_common_WInteger::max(0, $this->i - 20);
$e0 = com_wiris_common_WInteger::min($this->n, $this->i + 20);
return "..." . _hx_substr($this->str, $s0, $i0 - $s0) . " >>> . <<<" . _hx_substr($this->str, $i0, $e0);
}
示例2: escapeArgument
static function escapeArgument($arg)
{
$ok = true;
$_g1 = 0;
$_g = strlen($arg);
while ($_g1 < $_g) {
$i = $_g1++;
switch (_hx_char_code_at($arg, $i)) {
case 32:
case 34:
$ok = false;
break;
case 0:
case 13:
case 10:
$arg = _hx_substr($arg, 0, $i);
break;
}
unset($i);
}
if ($ok) {
return $arg;
}
return "\"" . _hx_explode("\"", $arg)->join("\\\"") . "\"";
}
示例3: now_in_colour
static function now_in_colour($old_sql, $completed, $start, $end, $char = null)
{
$sql = $old_sql;
$start -= 1;
$done = _hx_substr($sql, 0, $completed);
$left = _hx_substr($sql, $completed, $start - $completed);
$middle = _hx_substr($sql, $start, $end - $start);
$right = _hx_substr($sql, $end, null);
if (system_base_Sql_colour::$SYMBOLS->match($left)) {
$left = system_base_Sql_colour::$SYMBOLS->replace($left, "<span class=\"__symbs__ __bold__\">\$1</span>");
}
if (system_base_Sql_colour::$FUNCTIONS->match($left)) {
$left = system_base_Sql_colour::$FUNCTIONS->replace($left, "<span class=\"__funcs__ __bold__\">\$1(</span>");
}
if (system_base_Sql_colour::$RESERVED->match($left)) {
$left = system_base_Sql_colour::$RESERVED->replace($left, "<span class=\"__sqlv__ __bold__\"> \$1\$2 </span>");
}
if (!system_base_Sql_colour::$NUMBERS->match($left)) {
$left = system_base_Sql_colour::$NUMBERS->replace($left, "<span class=\"__literal__\">\$1</span>");
}
if ($char === null) {
$left = _hx_string_or_null($done) . _hx_string_or_null($left) . "<span class=\"__literal__\">" . _hx_string_or_null($middle) . "</span>";
} else {
$left = _hx_string_or_null($done) . _hx_string_or_null($left) . "<span class=\"__fields__\">" . _hx_string_or_null($middle) . "</span>";
}
return _hx_anonymous(array("position" => strlen($left), "string" => _hx_string_or_null($left) . _hx_string_or_null($right)));
}
示例4: getMathML
public function getMathML($digest, $latex)
{
if ($digest !== null) {
$content = $this->plugin->getStorageAndCache()->decodeDigest($digest);
if ($content !== null) {
if (StringTools::startsWith($content, "<")) {
$breakline = null;
$breakline = _hx_index_of($content, "\n", 0);
return _hx_substr($content, 0, $breakline);
} else {
$iniFile = com_wiris_util_sys_IniFile::newIniFileFromString($content);
$mathml = $iniFile->getProperties()->get("mml");
if ($mathml !== null) {
return $mathml;
} else {
return "Error: mathml not found.";
}
}
} else {
return "Error: formula not found.";
}
} else {
if ($latex !== null) {
return $this->latex2mathml($latex);
} else {
return "Error: no digest or latex has been sent.";
}
}
}
示例5: parseInt
static function parseInt($x)
{
if (!is_numeric($x)) {
return null;
}
return strtolower(_hx_substr($x, 0, 2)) == "0x" ? intval(substr($x, 2), 16) : intval($x);
}
示例6: substring
static function substring($s, $start, $end = null)
{
if ($end === null) {
return _hx_substr($s, $start, null);
}
return _hx_substr($s, $start, $end - $start);
}
示例7: matchedLeft
public function matchedLeft()
{
if (count($this->matches) === 0) {
throw new HException("No string matched");
}
return _hx_substr($this->last, 0, $this->matches[0][1]);
}
示例8: get_RELATIVE
static function get_RELATIVE()
{
if (zcale_core_path_targets_ServerPath::$relativePath === null) {
zcale_core_path_targets_ServerPath::$relativePath = haxe_web_Request::getURI();
zcale_core_path_targets_ServerPath::$relativePath = _hx_substr(zcale_core_path_targets_ServerPath::$relativePath, strlen(zcale_core_path_targets_ServerPath::get_FILE_DIR()), null);
}
return zcale_core_path_targets_ServerPath::$relativePath;
}
示例9: parse_file_path
static function parse_file_path($fullpath)
{
$pos = _hx_last_index_of($fullpath, "/", null);
if ($pos === -1) {
return _hx_anonymous(array("pathname" => "", "filename" => ""));
}
return _hx_anonymous(array("pathname" => _hx_substr($fullpath, 0, $pos), "filename" => _hx_substr($fullpath, $pos + 1, null)));
}
示例10: matchedRight
public function matchedRight()
{
if (count($this->matches) === 0) {
throw new HException("No string matched");
}
$x = $this->matches[0][1] + strlen($this->matches[0][0]);
return _hx_substr($this->last, $x, null);
}
示例11: nextSafeToken
public function nextSafeToken()
{
if ($this->i < $this->n) {
$this->c = haxe_Utf8::charCodeAt(_hx_substr($this->str, $this->i, null), 0);
$this->i += strlen(com_wiris_util_json_StringParser_0($this));
} else {
$this->c = -1;
}
}
示例12: hpOfString
public function hpOfString($s)
{
$parts = _hx_explode(":", $s);
if ($parts->length === 2) {
return _hx_anonymous(array("host" => new sys_net_Host($parts[0]), "port" => Std::parseInt($parts[1])));
} else {
return _hx_anonymous(array("host" => new sys_net_Host(_hx_substr($parts[1], 2, null)), "port" => Std::parseInt($parts[2])));
}
}
示例13: escape
public function escape($s)
{
$output = $this->pdo->quote($s, null);
if (strlen($output) > 2) {
return _hx_substr($output, 1, strlen($output) - 2);
} else {
return $output;
}
}
示例14: parseInt
static function parseInt($x)
{
if (!is_numeric($x)) {
$matches = null;
preg_match("/^-?\\d+/", $x, $matches);
return count($matches) === 0 ? null : intval($matches[0]);
} else {
return strtolower(_hx_substr($x, 0, 2)) === "0x" ? (int) hexdec(substr($x, 2)) : intval($x);
}
}
示例15: getCell
public function getCell($x, $y)
{
if ($x === 0) {
$v = $this->getCellView();
$txt = $v->toString($this->all->getCell($x, $y));
if (_hx_char_at($txt, 0) === "@") {
return _hx_substr($txt, 1, strlen($txt));
}
}
return $this->all->getCell($x, $y);
}