本文整理匯總了PHP中Inspekt::_walkArray方法的典型用法代碼示例。如果您正苦於以下問題:PHP Inspekt::_walkArray方法的具體用法?PHP Inspekt::_walkArray怎麽用?PHP Inspekt::_walkArray使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Inspekt
的用法示例。
在下文中一共展示了Inspekt::_walkArray方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getEscaped
/**
* Returns the value escaped with mysql_real_escape_string.
*
* @param mixed $value
* @return string
*
* @tag filter
*/
function getEscaped($value)
{
if (is_array($value)) {
return Inspekt::_walkArray($value, 'getEscaped');
} elseif (!empty($value)) {
global $CONFIG;
if (isset($CONFIG['LINK_ID']) && $CONFIG['LINK_ID']) {
return mysql_real_escape_string(htmlspecialchars($value, ENT_QUOTES), $CONFIG['LINK_ID']);
} else {
return mysql_real_escape_string(htmlspecialchars($value, ENT_QUOTES));
}
} else {
return $value;
}
}
示例2: escPgSQLBytea
/**
* Escapes the value given with pg_escape_bytea, so it should be safe for passing to a PostgreSQL BYTEA column
*
* @param mixed $value
* @param resource $conn the postgresql connection. If none is given, it will use the last link opened, per behavior of pg_escape_bytea
* @return mixed
*
* @link http://php.net/manual/en/function.pg-escape-bytea.php
*/
public static function escPgSQLBytea($value, $conn = null)
{
static $connection;
$connection = $conn;
if (Inspekt::isArrayOrArrayObject($value)) {
return Inspekt::_walkArray($value, 'escPgSQL');
} else {
if (isset($connection)) {
return pg_escape_bytea($connection, $value);
} else {
return pg_escape_bytea($value);
}
}
}
示例3: getEscaped
/**
* Returns the value escaped with mysql_real_escape_string.
*
* @param mixed $value
* @return string
*
* @tag filter
*/
function getEscaped($value)
{
if (is_array($value)) {
return Inspekt::_walkArray($value, 'getEscaped');
} elseif (!empty($value)) {
if (get_magic_quotes_gpc()) {
$value = stripslashes($value);
}
return mysql_real_escape_string($value);
} else {
return $value;
}
}
示例4: escPgSQLBytea
/**
* Escapes the value given with pg_escape_bytea
*
* @param mixed $value
* @param resource $conn the postgresql connection. If none is given, it
* will use the last link opened, per behavior of pg_escape_bytea
* @return mixed
*
* @link http://php.net/manual/en/function.pg-escape-bytea.php
*/
static public function escPgSQLBytea($value, $conn = null)
{
if (Inspekt::isArrayOrArrayObject($value)) {
return Inspekt::_walkArray($value, 'escPgSQL');
} else {
//might also check is_resource if pg_connection_status is too much
if (isset($conn) && pg_connection_status($conn) === PGSQL_CONNECTION_OK) {
return pg_escape_bytea($conn, $value);
} else {
return pg_escape_bytea($value);
}
}
}
示例5: noPath
/**
* Returns basename(value).
*
* @param mixed $value
* @return mixed
*
* @tag filter
* @static
*/
function noPath($value)
{
if (is_array($value)) {
return Inspekt::_walkArray($value, 'noPath');
} else {
return basename($value);
}
}