How To Add Arrays Within Arrays And Then Output Their Values In Index Aswell As Associative Array Format?
I got Mysql Tables:
//Valid list of Mysql Tables.
$tables = array('links','countries');
I got Mysql Table 'Links' Columns:
//Valid list of Mysql Table Columns.
$links_table_columns = array('email','domain','url','anchor','description','keyword');
I got Mysql Table 'Countries' Columns:
//Valid list of Mysql Table Columns.
$countries_table_columns = array('Australia','Canada','UK','USA','New Zealand');
Now, how do I add arrays within an array so by just looking at it you can tell which one is array and which ones are it's sub-arrays ?
I made two attempts: 1.
$tables_and_columns = array('table'=>array('links'),array('links'=>array('column'=>email,'column'=>domain,'column'=>url,'column'=>anchor,'column'=>description,'column'=>keyword)));
$valid_param_keys_and_values =
array($tables = array('links'), $links_table_columns = array('email','domain','url','anchor','description','keyword'))
$countries_tables = array('countries'), $countries_table_columns = array('Australia','Canada','UK','USA','New Zealand')));
Which one is valid, if any ?
Or, are there other ways of doing adding arrays within array ?
In short, what are the various valid ways you can add arrays within arrays and what are the various ways to output the array values and the sub-arrays' values both in Index and Associative Array format ?
source https://stackoverflow.com/questions/68595903/how-to-add-arrays-within-arrays-and-then-output-their-values-in-index-aswell-as
Comments
Post a Comment