undefined offset when using php explode()

后端 未结 7 1986
闹比i
闹比i 2020-12-03 17:07

I\'ve written what I thought was a very simple use of the php explode() function to split a name into forename and surname:

// split name into f         


        
7条回答
  •  抹茶落季
    2020-12-03 17:44

    array_pad is the only valid answer in this thread, all others are ugly hacks that can explode into your face. With array_pad you can always be sure that the amount of elements is correct and filled. Especially important when using with a list() type output.

提交回复
热议问题