I have the following code..
[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--] // Get the position of the first space
$firstSpacePosition = strpos($line, ' ');
// Update array for the file names (everything after the first space)
$this->fileArray[$i] = substr($line, $firstSpacePosition, strlen($line));
// Update array for the directory names (everything before the first space)
$this->directoryArray[$i] = substr($line,0,$firstSpacePosition);
// Increment the counter
This looks at a line, finds the first space, then just takes everything after the first space and makes it fileArray[$i]. Everything before the first space becomes directoryArray[$i]. I'd like to make it so that everything before the first space is still directoryArray[$i], but then the word after the 1st space becomes secondArray[$i] and everything after the SECOND space becomes fileArray[$i].
/directory/directory secondword file that I want displayed
directoryArray = /directory/directory
secondArray = secondword
fileArray = file that I want displayed
Thanks for the help!
Reading After The 2nd Space
1 reply to this topic
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users