Apologies for the complete geekery of this post.
I have some data in a file and I would like to manipulate it using PHP to produce an HTML output. Not being very familiar with file-handling, can anyone suggest how I get the data into a usable form?
The input file contains (almost) fixed width data in the form:
texttexttexttexttext ##### textext ### texttextext ###
where texttexttext is a string and #### is a number.
I’d like to import the file into a two-dimensional array, the first part containing the text (trimmed of spaces to the right), with the second containing the number (with any whitespace either side trimmed). The text field is 60 wide and the number field is 8 wide.
Does anyone have any handy code to do this, please? I’ve had a Google and can’t find what I’m after. It’s not so much the trimming as getting the two bits of data into different parts of the array. Thanks.
Recent comments