user1448015
user1448015

Reputation: 11

preg_match get multiple

I have a page like w/e more HTML I need to grab all the data between the tags and not the first one. Currently I use

<?php([^<]*?)\?>/"

But it grabs the first one and stops. Any help?

Upvotes: 1

Views: 217

Answers (2)

Mike Mackintosh
Mike Mackintosh

Reputation: 14237

Look into the function preg_match_all.

Upvotes: 2

Altaf Hussain
Altaf Hussain

Reputation: 1048

use this with preg_match_all()

preg_match_all("/<?php([^<]*?)\?>/siU",$html,$output);
print_r($output[1]);

Upvotes: 1

Related Questions