user753317
user753317

Reputation:

Get all occurrences of "EUR " followed by a price with a comma as the decimal separator

Suppose I have a string like this

EUR 5,00 paid by Robert. EUR 500,00 Paid By Alberto Del Rio.

I want to extract the the following output:

array(
  [0]=>EUR 5,00
  [1]=>EUR 500,00
)

Upvotes: 0

Views: 67

Answers (1)

Amber
Amber

Reputation: 527173

$results = array();
preg_match_all("/EUR [0-9,.]+/", $input_string, $results);

Upvotes: 7

Related Questions