Hello. im having this code:
public function parse_reports($filename)
{
$result = array();
$fp = fopen($filename, "r");
if (($headers = fgetcsv($fp, 0, "\t")) !== FALSE)
if ($headers)
while (($line = fgetcsv($fp, 0, "\t")) !== FALSE)
if ($line)
if (sizeof($line)==sizeof($headers))
$result[] = array_combine($headers,$line);
fclose($fp);
return $result; //return result
}
and my array list its like:
Array
( //test array1
[0] => Array
( //array 0
[VNUM] => 1
[LOCALE_NAME] => Yang
)
[1] => Array
( //array 1
[VNUM] => 2
[LOCALE_NAME] => Ελληνική Έκδοση
)
[2] => Array
( //array 2
[VNUM] => 10
[LOCALE_NAME] => Σπαθί+0
)
[3] => Array
( //array 3
[VNUM] => 11
[LOCALE_NAME] => Σπαθί+1
)
what i need is for array numbers to take VNUM Number for example looks like this:
Array
(
[1] => Array
(
[VNUM] => 1 //this take the value of VNUM
[LOCALE_NAME] => Yang
)
[2] => Array
(
[VNUM] => 2 //this take the value of VNUM
[LOCALE_NAME] => Ελληνική Έκδοση
)
[10] => Array //this take the value of VNUM
(
[VNUM] => 10 //this take the value of VNUM
[LOCALE_NAME] => Σπαθί+0
)
[11] => Array
(
[VNUM] => 11 //this take the value of VNUM
[LOCALE_NAME] => Σπαθί+1
)
as you can see what i need is to change arrays id with the VNUM that my .txt header have...if someone could help me with this i would be very happy! thank you! if you need any more details feel free to ask me
Fixed thanks to Eddie