Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

php typecast class

// make sure to include the namespace when casting
$className = "SomeNameSpaceSomeClassName";
$classNameLength = strlen( $className );
$castedItem = unserialize(
    preg_replace(
        '/^O:d+:"[^"]++"/',
        "O:$classNameLength:"$className"",
        serialize( $item )
    )
)
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #php #typecast #class
ADD COMMENT
Topic
Name
2+9 =