php explode: split string into words by using space a delimiter

后端 未结 6 2071
粉色の甜心
粉色の甜心 2020-12-08 15:17
$str = \"This is a    string\";
$words = explode(\" \", $str);

Works fine, but spaces still go into array:

$words === array (\'This         


        
6条回答
  •  心在旅途
    2020-12-08 16:03

    $financialYear = 2015-2016;

    $test = explode('-',$financialYear);
    echo $test[0]; // 2015
    echo $test[1]; // 2016
    

提交回复
热议问题