php -> preg_replace -> remove space ONLY between quotes

后端 未结 2 596
滥情空心
滥情空心 2021-01-15 05:16

I\'m trying to remove space ONLY between quotes like:

$text = \'good with spaces \"here all spaces should be removed\" and here also good\';
<
2条回答
  •  误落风尘
    2021-01-15 06:08

    See the following code snippet:

    
    

    I found a sample that works in the wrong direction :-(


    @Graham: correct

    $text = 'good with spaces "here all spaces should be removed" and here also good'
    should be 
    $text = 'good with spaces "hereallspacesshouldberemoved" and here also good';
    

提交回复
热议问题