in reply to Looping failure
Update, clarified what I ment with 'it'
$element has been declared at the start of my code as global so i can use in lots of loops.