Switch language

wpseek.com
A WordPress-centric search engine for devs and theme authors




is_serialized_string [ WordPress Function ]

is_serialized_string ( $data )
Parameters:
  • (mixed) $data Serialized data
Returns:
  • (bool) False if not a serialized string, true if it is.
Defined at:



Check whether serialized data is of string type.

Source


<?php
function is_serialized_string$data ) {
    
// if it isn't a string, it isn't a serialized string
    
if ( !is_string$data ) )
        return 
false;
    
$data trim$data );
    
$length strlen$data );
    if ( 
$length )
        return 
false;
    elseif ( 
':' !== $data[1] )
        return 
false;
    elseif ( 
';' !== $data[$length-1] )
        return 
false;
    elseif ( 
$data[0] !== 's' )
        return 
false;
    elseif ( 
'"' !== $data[$length-2] )
        return 
false;
    else
        return 
true;
}
?>

Examples [ wp-snippets.com ]

Google Arama Sonuçlarý

Dahasý ...

Kullanýcý Tartýþmalarý [ wordpress.org ]

- Bulunamadý -

Yeni bir konu yaz ...

0 User Note(s)

Henüz yok. Ýlk sen ol!

Yeni Ekle ...



HTML5 Powered with CSS3 / Styling, Performance & Integration, and Semantics