If you directly copy a tab character into a function argument, then it works, but when using \ t, no. Why is that?

  • 3
    because it is necessary to explode("\t",$array) in double quotes. - Naumov
  • 3
    Interpolation works only in double ( " ) quotes. Single ( ' ) is just a slash and t characters. - user207618
  • @IvanSkald, If you are given an exhaustive answer, mark it as correct (click on the check mark next to the selected answer). - user207618

1 answer 1

Interpolation works only in double ( " ) quotes. In single ( ' ) it is just a slash and t characters.

 $str = 'one two three'; var_dump(explode('\t', $str)); // Не сработает var_dump(explode("\t", $str)); // Заработало! 

http://ideone.com/fMIcjW