Answers for "php add value to inner array"

PHP
1

php add array to array

$a = array('a','b','c');
$b = array('c','d','e');

array_push($a, ...$b);
print_r($a);
/*
notice this is different than array merge as it does not merge
values that the same 
Array
(
    [0] => a
    [1] => b
    [2] => c
    [3] => c
    [4] => d
    [5] => e
)
*/
Posted by: Guest on February-22-2022
-2

how to append one array to another array in php

((data.userDetails.profile_picture === null) ||(data.userDetails.profile_picture===undefined))? picture ='<div><img src="http://commondatastorage.googleapis.com/codeskulptor-assets/lathrop/nebula_brown.png"' :
          picture = '<img src="'+data.userDetails.profile_picture+ '"/>';
Posted by: Guest on September-04-2020

Browse Popular Code Answers by Language