Jump to content

preg to get string between to characters


luminous

Recommended Posts

I'm rubbish with REGEX, I need help extracting a string between two characters like so:

 

$date = "Wednesday, June 23, 2010";

preg_match ("/[,](.*)[,]/", $date, $matches);

which gives me:

Array
(
    [0] => , June 23,
    [1] =>  June 23
)

 

However I only want the second value (without the ',' at the beginning and the end)

 

help me please!

Archived

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

×
×
  • Create New...

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.