PHP - Remove all tabs from string

前端 未结 5 1538
生来不讨喜
生来不讨喜 2021-02-01 03:21

I am able to remove all single tabs from a string:

// Copying and pasting the tab directly
$txt = str_replace(\"    \", \"\", $txt); 

This only

5条回答
  •  囚心锁ツ
    2021-02-01 03:58

    $string = trim(preg_replace('/\t/', '', $string));

    This works for me. Remove the g of @Mr. Aliens answer.

提交回复
热议问题