I was expecting that the explode function of the following string
$lines[1]="Start_time= ". $ST. ':' . $STIMI."
" ;
would give me Array[0]= Start_time, Array[1]= $ST, Array[2]= :, Array [3]= $STIMI
But the explode function gives me: Array[0]= Start_time Array[1]= $ST:$STIMI
$ST
and $STIMI
are both variables. Any idea how to fix this
The explode function takes a parameter by which to explode the string. Presuming you are using a blank space you will need to add a blank space on either side of your colon.
$lines[1]="Start_time= ". $ST. ' : ' . $STIMI."
" ;
Explode by using the ":" separator as opposed to " "
$STIME=explode(":", $lines[1]);
Mind that if you have ":" in your strings it will mess up your algorithm.