Hy, Im trying to insert into an array part of a string from a text file.
The text file contains characters that I wish to insert in the array. A --> * character is between each entry that I want to separate in the array. Therefore it looks like this:
When I view the sizeOf the Array it shows that I have 2 elements in the array, but in fact I only have one entry (only one * character in people.txt)
// Write all data to people.txt
$fp = fopen ( "people.txt", "a");
fwrite ($fp, $inputString);
$tokensArr = Array();
$filename = "people.txt"; // File which holds all data
$fp = fopen ( $filename, "r");
$content = fread( $fp, filesize( $filename ) );
$tokensArr = explode ("*",$content);
Why is the size of the array 2 and not 1 ?