How do I echo saved data outside the function? October 23, 2022 by Tarik Billa You’d need to declare $lineOne as global inside your function: global $lineOne; Messy way of coding though.