Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

add element into array in php

<?php
$db_user = array("user_id", "user_name", "email");
array_push($db_user, "contact");
print_r($db_user);
?>
  
  Output:

Array
(
    [0] => user_id
    [1] => user_name
    [2] => email
    [3] => contact
)
Source by onecompiler.com #
 
PREVIOUS NEXT
Tagged: #add #element #array #php
ADD COMMENT
Topic
Name
6+4 =