How to retrieve a script function value in PHP value?