PHP separate string

前端 未结 2 1499
暖寄归人
暖寄归人 2021-01-29 16:39

I have a string that contains 128.82. I want to split/separate them in 100 and 28.82.

var_dump(substr($kwh,0,3));
        d         


        
2条回答
  •  [愿得一人]
    2021-01-29 17:04

    If you want to split 128.82 into 100 and 28.82 You can do it like this:

    This will result in:

    Array ( [0] => 100 [1] => 28.82 ) 
    

提交回复
热议问题