How do I explode an integer

前端 未结 3 545
伪装坚强ぢ
伪装坚强ぢ 2020-12-11 00:22

the answer to this could be easy. But I\'m very fresh to programming. So be gentle...

I\'m at work trying to do a quick fix for one of your customers. I want to get

3条回答
  •  囚心锁ツ
    2020-12-11 01:04

    Use the str_split() function:

    $array = str_split(1331000000);
    

    Thanks to PHP's automated type coercion the passed int will be converted to a string automatically. But if you want you can also add an explicit cast.

提交回复
热议问题