I need to only take away the number that is in the third list item and filter everything else out. It is possible that a number could be found within the first or second list items.
How can I do a loop that extracts my number from the third <li> item every time and places it into a variable?
Does it matter where the number is or does it matter to just extract numbers from the string provided?
If it matters where the number is, you use regexp to match all <li></li> elements (probably with preg_match_all(“#<ul>([(.*)[1]]</ul>#”, $str, $matches); -> note, I could be wrong here) and then you explode the matches you got by </li> delimiter.
Then you loop trough the array you just got and you use regexp to match the digits. If digit is matched, you’re done.
I could post the entire code for this, but I’m kinda in a rush to leave home so I’m sorry for not doing it
yeah the tricky bit here is that it is possible that numbers may exist in the first or second list items. So I can’t do a match for numbers on the whole list.