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>([(.*)^[</ul>]]</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