PHP - Remove all tabs from string

前端 未结 5 1536
生来不讨喜
生来不讨喜 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:51

    this will remove all tabs in your variable $string

    preg_replace('/\s+/', '', $string);
    

提交回复
热议问题