Split string into 2 pieces by length using PHP

前端 未结 3 1804
别跟我提以往
别跟我提以往 2021-01-17 08:00

I have a very long string that I want to split into 2 pieces.

I ws hoping somebody could help me split the string into 2 separate strings.

I need the first s

3条回答
  •  无人及你
    2021-01-17 08:19

    $first400 = substr($str, 0, 400);
    $theRest = substr($str, 400);
    

    You can rename your variables to whatever suits you. Those names are just for explanation. Also if you try this on a string less than 400 characters $theRest will be FALSE

提交回复
热议问题