“PHP Array Serialize” Código de respuesta

Serialize () PHP

<?php

$arrayName = array();
array_push($arrayName, "messie");
array_push($arrayName, "cr7");
print_r($arrayName); //output is => Array ( [0] => messie [1] => cr7 )
$serial = serialize($arrayName);
print("<br>");
print($serial); //output is =>a:2:{i:0;s:6:"messie";i:1;s:3:"cr7";}

// a is arrray ; 2 is the number of the ietems insid the array ;
 //i is the index ; s is the number of the chracters ;
$serial=unserialize($serial);
print("<br>");
print_r($serial);//output is => Array ( [0] => messie [1] => cr7 )



?>
AHMAD ALHAMADA

PHP Serialize Array

$array["a"] = "Foo";
$array["b"] = "Bar";
$array["c"] = "Baz";
$array["d"] = "Wom";

$str = serialize($array);
Worrisome Whale

PHP Serialize ()

php array to be storable value in $_SESSION:
 serialize($array)
  serialized array element to be output on page:
unserialize($serializedArray)
CuteKittyCat

PHP Array Serialize

//If you plan to serialize and store it in file or database use below syntax
//to safely serialize
$safe_string_to_store = base64_encode(serialize($multidimensional_array));

//to unserialize...
$array_restored_from_db = unserialize(base64_decode($encoded_serialized_string));
eswaran

Respuestas similares a “PHP Array Serialize”

Preguntas similares a “PHP Array Serialize”

Más respuestas relacionadas con “PHP Array Serialize” en PHP

Explore las respuestas de código populares por idioma

Explorar otros lenguajes de código