samedi 25 avril 2015

How to get a substring until a specific character with preg_match in php?


Assuming I have these variations:

1: Today is a beautiful day (Monday)

2: Today is a beautiful day

I want to get Today is a beautiful day.

I'm trying preg_match('/(?=(^\w+.+))$|(?=(^\w+.+)\s\())/ui', $string, $matches) without success.


Aucun commentaire:

Enregistrer un commentaire