Joan Silverstone
Joan Silverstone

Reputation: 385

getting a value from inside parenthsis with pre-match

i am parsing same HTML i need to get a number from a line of HTML

<div class='overflow150'><a style='display:block;height:15px;'   href="javascript://" onclick="openPlayerDetailsWindow(27435430)">Jan Partlji&egrave;</a></div>

i need the numbers inside the parethsis at openPlayerDetailsWindow(27435430)

i am trying the following but no luck:

preg_match('#\((.*?)\,#', $html_row, $player_id);

i am such a newbie with pre match, any help?

Upvotes: 0

Views: 218

Answers (1)

Arvin
Arvin

Reputation: 2282

Try using:

preg_match('#\(([0-9]+)\)#', $html_row, $player_id);
$player_id = $player_id[1];

Upvotes: 1

Related Questions