Php Function Within Function Javascript Code Checker