Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

convert array to associative array php

<?php
$a = array("foo", "bar");
$aa = array();
foreach ($a as $idx => $val) {
  $aa[$val] = $idx + 1;
}
print_r($aa);
?>
Source by infoheap.com #
 
PREVIOUS NEXT
Tagged: #convert #array #associative #array #php
ADD COMMENT
Topic
Name
7+8 =