Jump to content

Archived

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

Ninjakreborn

regex for commas

Recommended Posts

I am trying to find some regular expressions to check for commas after each word, is there any you know of I tried google searches with no luck, and www.regular-expressions.info doesn't seem to have anything specific either.

Share this post


Link to post
Share on other sites
Commas after each word?
For what you'd need that? How exactly you want it to match? What is a "word"?

Share this post


Link to post
Share on other sites
www.funnyemailforwards.com the keywords, I have to validate them to seperate by commas for the database don't I.

Share this post


Link to post
Share on other sites
you can use explode? which will split the keywords up into an array then you can validate each keyword one by one:
[code]$keywords = explode(',', $_POST['keywords'];

foreach($keywords as $k => $v)
{
    //validate each keyword, $v stores the keyword.
}[/code]

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.