Jump to content

divide the string only into two part


pankaj.ghadge

Recommended Posts

hello , I want split the string into 2 parts.e.g 1)10:16:5210999_aa@mydomain.com/jsjac_simpleclient -> 10999_cc/ > hi cc sds ds s / > sdsdsd / > s s sds <Output:- str_array[0]=10:16:5210999_aa@mydomain.com/jsjac_simpleclient -> 10999_cc str_array[1]=hi cc sds ds s / > sdsdsd / >s s sds <2)10:17:31 10999_cc/jsjac_simpleclient ->10999_aa/ < d dd ddd<< / >> / << dddoutput:- str_array[0]=10:17:31 10999_cc/jsjac_simpleclient ->10999_aa str_array[1]=d dd ddd<< / >> / << ddd I want to split the string into two part by using separator / > or/ < (There is space between / and >)Consider first appearance of separator to divide the string into two parti want divide the string only into two part , but other function available in php divides the string into several part if it found separator character. So please tell me how to do this . is there any inbuilt function available in php?...........................................

Link to comment
Share on other sites

explode() will do that. But I don't see where it might work if there are several of the divider characters in the String.And what are the rules about which one to use. Your examples are unclear.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...