Search
 
SCRIPT & CODE EXAMPLE
 

PHP

php multiple array to single array

$array = array_column($array, 'plan'); 
// plan adalah nama kolom nya  
// $array adalah variable nya 
// semisal pengen membuat get data jadi single array bisa seperti ini 
     $CI = get_instance(); 
	 $DB1 = $CI->load->database('nama_db', TRUE);
	 $sql = "select dept from v_dept_distinct order by dept asc ";
	  $query=$DB1->query($sql);
	  // print_r(array_column($query->result_array() , 'dept')); 
	  return  array_column($query->result_array() , 'dept');

Comment

PREVIOUS NEXT
Code Example
Php :: php mysql row to json 
Php :: html table to array php 
Php :: laravel verification email 
Php :: how to get the ip address of the client in php 
Php :: subquery in laravel 
Php :: wordpress programmatically change slug of media attachment site:wordpress.stackexchange.com 
Php :: upgrade php 5.6 to 7 centos 7 
Php :: how to append one array to another array in php 
Php :: laravel get only validated data 
Php :: Email "" does not comply with addr-spec of RFC 2822. 
Php :: laravel transaction 
Php :: bootstap 5 add scrollbar 
Php :: php invoke method 
Php :: howw to see if a value is posted laravel 
Java :: javafx vm arguments 
Java :: Manifest merger failed : Apps targeting Android 12 and higher are required to specify an explicit value for `android:exported` 
Java :: change java version command line debian 
Java :: minecraft bedrock save location 
Java :: java pause 
Java :: java lambda foreach multiple statements 
Java :: JFrame Exit on close Java 
Java :: java how to get current date 
Java :: refresh activity android 
Java :: input double java 
Java :: How to change progressbar color xml android 
Java :: internet permission in android studio 
Java :: java remove file extension from file name 
Java :: android back navigation 
Java :: java create date object from yesterday 
Java :: java for schleife 
ADD CONTENT
Topic
Content
Source link
Name
7+5 =