Php Function Use External Variables Science