i want a function do that,
select the action / name to be output : 2 => Weapon Mastery
Code: Select all
( skill
( name "Weapon Mastery")
( action 2)
( image "passive001")
)
( skill
( name "Lightning Slash")
( action 3)
( image "active003")
)Code: Select all
function extract($string){
preg_match_all("/action [0-9]+/i", $string, $matches);
return $matches[0];
}
$outs = extract($text);
$ago = (implode($outs,",<br>"));
print(preg_replace('/action/','',$ago));2
3
but i didnt find the way to select the action / name in same time
to be outputs : 2 => Weapon Mastery[/img]