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 :: wc php get product category in product page 
Php :: laravel order by relationship 
Php :: laravel old request radio check 
Php :: woocommerce order get_data() 
Php :: db::statement in laravel 
Php :: serve in localhost using php 
Php :: delete_user hook in wordpress 
Php :: random word using a wordlist php 
Php :: add shortcode in short description 
Php :: php get current time and date 
Php :: br php 
Php :: php header pdf 
Php :: php undefined function split 
Php :: php connection mysqli database 
Php :: laravel migration change column default 
Php :: php sql get single value 
Php :: laravel foreach loop index from 1 
Php :: how to check if user is logged in wordpress 
Php :: php qrscanner webcam 
Php :: laravel timestamp 
Php :: wherebetween date laravel 
Php :: delete all cookies in php 
Php :: how to bulk insert array into sql php 
Php :: delete uploaded file php 
Php :: laravel get request check 
Php :: how to send ajax request in laravel 
Php :: php check string is int 
Php :: php sort multi dimensional array 
Php :: laravel try catch example 
Php :: php convert string to int in array 
ADD CONTENT
Topic
Content
Source link
Name
3+8 =