Think I'm running in circles here.
I have a CSV file which the fields are separated by ';'.
The last field contains e.g. 52451 Butikkhandel med elektriske husholdningsapparater, radio og fjernsyn, 51874 Engroshandel med maskiner og utstyr til handel, transport og tjenesteyting ellers
Now I need to extract the numbers and put them into an array.
So I get an array containing 52451 and 51874. There may be more or fewer numbers.
Here's my code so far:
$fp = fopen ("DB/TestData/testdata2.csv","r");
echo "File opened<br>";
$arrOrganization = array ();
$arrAddress = array();
$arrPerson = array();
$arrBusinessArea = array();
$arrBA = array();
while ($arrData = fgetcsv ($fp, 1000, ";"))
{
array_push($arrOrganization, $arrData[0], $arrData[1], $arrData[5], $arrData[6], $arrData[7]);
array_push($arrAddress, $arrData[0], $arrData[2], $arrData[3]);
array_push($arrPerson, $arrData[4]);
array_push($arrBusinessArea, $arrData[8]);
$arrBA = explode(",",$arrBusinessArea[0]); // <-- This is wrong
}
fclose ($fp);
It's this line I have problems with:
$arrBA = explode(";",$arrBusinessArea[0]);
Eventually it all goes into a database.
Any help apprechiated.