The text I'm searching in has 2 possible looks (warlord or warlady), like these:
<h3>John - level 22 Warlord</h3>
<h3>Kitty - level 5 Warlady</h3>
<h3>Maryanne - level 16 Warlady</h3>
<h3>Mr. Drinkalot - level 9 Warlord</h3>
I need to pick up the level like this:
22
5
16
9
I tried this code but it only picks up one - either the Warlords or the Warladies (when I tweak it) but never both...
What am I doing wrong?
Code: Select all
$temp0=substr($connect,strpos($connect,'</h3>')-9,7);
if ($temp0 == 'Warlord') {
$temp=substr($connect,strpos($connect,'Warlord</h3>')-3,-2);
} else {
$temp=substr($connect,strpos($connect,'Warlady</h3>')-3,-2);
}