undefined offset when using php explode()

后端 未结 7 2017
闹比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:35

    Presumably, whatever $fullname is doesn't contain a space, so $split is an array containing a single element, so $split[1] refers to an undefined offset.

提交回复
热议问题