Hi Guys - I'm very new to PHP and I have been reading for quite some time but I'm not quite understanding a specific component.
Basically what I am trying to achieve is; [Not sure how to put it in english so I'll step through what I am doing initially in list form;]
1. I run a script which outputs a generically 6x lines of text (Will always be 6 lines) followed by outputting "a variable" amount of rows which contain data which I would like to store as individual variables which are parsed into an array which I can then use to pull and insert in to a specific MYSQL database.
The way that the text file is layed out seems very straight forward; I.E...
15 columns containing data
11 columns containing no data / blank / spacial seperators
Variable amount of rows
Each column has a specific "descriptor" - name of the colum/purpose
My current script is below - starting it off; - Using it for self learning purposes
<?php
//Defines a variable for the results file I'm pulling information from;
$myFile = "./'results file here.txt'";
// Define a variable and the string that is pulled from line 8 in the results file will be outputted
$row1 = file($myFile); //Pulls First Row of the specific file
echo $lines[8]; // Line 8
?>
What I am hoping to do is some how produce a regular expression which will create a variable dynamically depending on the amount of rows that are present and add that content to an array. From here I would like to pull the specific column values from each row and output them in to a new array which I can then use to drop the column and row information in to the MYSQL Database.
The main question is - Is this an unorthadox over complicated way of achieving something that potentially could be done using an export/import type function within PHP? The last thing I would like to see is me trying to script an EXPORT function which has already been created for this exact purpose
Any assistance would be hugely appreciated - sorry if this makes no sense.
Thanks
A