PHP trim() not doing what it's supposed to do

Okay, I have a parsed string (a line-fragment from a text), that for some reason have a lot of whitespace - one should think trim() would fix that, but for some reason, it doesn't work.

Here's the relevant part of the code:

foreach($getfile as $line) {
  if (strstr($line, 'h4')) {
  $get_link_id = str_replace('"','',strstr(strstr($line,'"'),'">',true));
  $digit = explode('. ',$line)[0];
  var_dump($digit); //this outputs that the $digit-variable is 19 characters, instead of 1 or 2...
Code (markup):
PHP trim() not doing what it's supposed to do

from PHP http://ift.tt/1oW4Y1x
via IFTTT
Thanks for your comment
Loading...