Re: [PHP] Regular Expression to get the whole Comma Separated String in Array Key

2010-06-30 Thread Richard Quadling
On 30 June 2010 15:12, Gaurav Kumar wrote: > Hi All, > > Need help in resolving the below problem- > > > I would like to get the whole comma separated string into an array value- > > 1. $postText = "chapters 5, 6, 7, 8"; > OR > 2. $postText = "chapters 5, 6; > OR > 3. $postText = "chapters 5, 6, 7

[PHP] Regular Expression to get the whole Comma Separated String in Array Key

2010-06-30 Thread Gaurav Kumar
Hi All, Need help in resolving the below problem- I would like to get the whole comma separated string into an array value- 1. $postText = "chapters 5, 6, 7, 8"; OR 2. $postText = "chapters 5, 6; OR 3. $postText = "chapters 5, 6, 7"; What i have done so far is- preg_match('/chapter[s]*[ ]*(\d+