rookwood Posted September 13, 2010 Share Posted September 13, 2010 I am trying to split some strings up by commas with preg_split but I keep on getting the error: "No ending delimiter ',' found" Here is my Code: $links = preg_split(',', $links); $titles = preg_split(',', $titles); $images = preg_split(',', $images); Thanks, Alex Quote Link to comment Share on other sites More sharing options...
inversesoft123 Posted September 13, 2010 Share Posted September 13, 2010 alternatively you can use explode $split=explode(",", $links); echo "1. $split[0] <br/>2. $split[1] etc etc..."; Quote Link to comment Share on other sites More sharing options...
rookwood Posted September 13, 2010 Author Share Posted September 13, 2010 Thanks it works now Quote Link to comment Share on other sites More sharing options...
AbraCadaver Posted September 13, 2010 Share Posted September 13, 2010 Thanks it works now You see now that explode() is the more appropriate function, but to answer you question: preg functions need a regular expression which consists of some starting and ending delimiters. They can be most anything but common ones that you will see are / # ~. $links = preg_split('/,/', $links); Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.