Регистрация
Войти
Войти через VK Войти через FB Войти через Google Войти через Яндекс
Войти через VK Войти через FB Войти через Google Войти через Яндекс
Поиск по сайту
PHP Поиск
Наша группа в Telegram для обмена идеями, проектами, мыслями, людьми в сфере ИТ г.Ростова-на-Дону: @it_rostov
is_buffer
(PHP 6 >= 6.0.0)
is_buffer — Finds whether a variable is a native unicode or binary string
Описание
bool is_buffer ( mixed $var ) Finds whether the given variable is a native unicode or binary string.Параметры
var The variable being evaluated.Возвращаемое значение
Returns TRUE if varunicode or binary string, FALSE otherwise.
Примеры
Example #1 is_buffer() example
// Declare some variables with different types
$types = array(
'unicode' => 'Unicode string',
'binary' => b'Binary string',
'resource' => fopen('php://stdin', 'r'),
'integer' => 42
);
// Test which types thats a buffer
foreach($types as $type => $value)
{
if(is_buffer($value))
{
echo $type . ' is a either a unicode or binary string';
}
else
{
echo $type . ' is not a buffer value';
}
echo PHP_EOL;
}
Результат выполнения данного примера:
unicode is a either a unicode or binary string binary is a either a unicode or binary string resource is not a buffer value integer is not a buffer valueСмотрите также
- is_binary() - Finds whether a variable is a native binary string
- is_string() - Find whether the type of a variable is string
- is_unicode() - Finds whether a variable is a unicode string
Описание на ru2.php.net
Описание на php.ru