downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

is_callable> <is_bool
Last updated: Fri, 30 Oct 2009

view this page in

is_buffer

(PHP 6 >= 6.0.0)

is_bufferPrüft, ob eine Variable ein nativer Unicode- oder Binärstring ist

Beschreibung

bool is_buffer ( mixed $var )

Prüft, ob eine Variable ein nativer unicode- oder binary-String ist.

Parameter-Liste

var

Die zu prüfende Variable.

Rückgabewerte

Liefert TRUE, wenn var ein nativer unicode- oder binary-String ist, sonst FALSE.

Beispiele

Beispiel #1 is_buffer()-Beispiel

<?php
// Deklariere Variablen verschiedener Typen
$types = array(
            
'unicode'    => 'Unicode string',
            
'binary'    => b'Binary string',
            
'resource'    => fopen('php://stdin''r'),
            
'integer'    => 42
            
);

// Prüft, welche Variablen Strings sind
foreach($types as $type => $value)
{
    if(
is_buffer($value))
    {
        echo 
$type ' ist ein Unicode- oder Binärstring';
    }
    else
    {
        echo 
$type ' ist keine Buffervariable';
    }

    echo 
PHP_EOL;
}
?>

Das oben gezeigte Beispiel erzeugt folgende Ausgabe:

unicode ist ein Unicode- oder Binarystring
binary ist ein Unicode- oder Binärstring
resource ist keine Buffervariable
integer ist keine Buffervariable

Siehe auch

  • is_binary() - Prüft ob eine Variable ein nativer Binärstring ist
  • is_string() - Prüft, ob Variable vom Typ string ist
  • is_unicode() - Prüft ob eine Variable ein Unicode-String ist



add a note add a note User Contributed Notes
is_buffer
There are no user contributed notes for this page.

is_callable> <is_bool
Last updated: Fri, 30 Oct 2009
 
 
show source | credits | stats | sitemap | contact | advertising | mirror sites