I want to be able to create an array like the below:
$array = array('one' => '1', 'two' => '2');
but by using code like this:
$array=array();
$array = 'one'
$array = 'two'
but how do i create the second part of each item in the array?
try this:
<?php
$array=array();
$array['one'] =1 ;
$array['two'] =2 ;
print_r($array);
?>
NOTE: if you want array with numeric key in your implementation you can do this:
<?php
$array=array();
$array[1] ='one' ;
$array[] ='two' ;
$array[] ='three' ;
print_r($array);
?>
try this
<?php
$array=array();
$array['one'] = 1;
$array['two'] = 2;
print_r($array);
?>
$array['one'] = '1'and so on.