Search
 
SCRIPT & CODE EXAMPLE
 

PHP

save array in mysql php

$names_arr = array(“Toni Abbah”,”Anastacia Mast”,”Soji Igbonna”);
// Associative Array
$users_arr[] = array(“username”=>”Torah”,”name”=>”Toni Abbah”);
$users_arr[] = array(“username”=>”Anamast”,”name”=>”Anastacia Mast”);
$users_arr[] = array(“username”=>”soggy”,”name”=>”Soji Igbonna”);
// Serialize the Array
$names_str = serialize($names_arr);
$users_str = serialize($users_arr);
Comment

php save array in mysql database

$array = array("my", "litte", "array", 2);

$serialized_array = serialize($array); 
$unserialized_array = unserialize($serialized_array); 

var_dump($serialized_array); // gives back a string, perfectly for db saving!
var_dump($unserialized_array); // gives back the array again
Comment

PREVIOUS NEXT
Code Example
Php :: composer require no cache 
Php :: get post php 
Php :: laravel make component 
Php :: migration laravel 
Php :: laravel created_at changing 
Php :: change the php version in linux 
Php :: Fetch Multiple Rows in PHP 
Php :: delete route method in laravel 
Php :: laravel throw function 
Php :: cakephp json response 
Php :: web scraping in php 
Php :: Generating Random String In PHP Using uniqid() function 
Php :: php curl Content-Length 
Php :: factory laravel 
Php :: php ternary operators 
Php :: laravel validation decimal 
Php :: create if not exist laravel 
Php :: varchar max length define laravel migration 
Php :: db name laravel 
Php :: php laravel config 
Php :: php read csv 
Php :: convert scientific notation to decimal php 
Php :: env value return null laravel 
Php :: php is defined 
Php :: laravel collection map 
Php :: how to check if key is present in json in php 
Php :: Array to XML Conversion using PHP 
Php :: how to do a submit button in php without reloading the page 
Php :: laravel query builder get last insert id 
Php :: symfony set content type 
ADD CONTENT
Topic
Content
Source link
Name
3+2 =