<div>Note that this function will execute the php code, which may give some PHP errors and stop executing the script.<br/>
Send $contents to the url page through curl and check if the answer is == 1. Othewise is not valid.<br/>
The idea is to have a file that calls the isValidPHPContentsViaUrl which will call another file (via URL) which will include the php code and echo "1". The first file will check then the request's response and if it is == 1, the code is valid, otherwise it shows the error.</div>
<h5>Validates HTML with PHP code via command line:</h5>
<div>Note that this function only check the php syntax. Do not executes the code.<br/>
Server must have the php command line defined. Otherwise you can use the methods isValidPHPContents or printPHPContentsViaUrl + isValidPHPContentsViaUrl. </div>
<div>Note that this function will execute the php code, which may give some PHP errors and stop executing the script.<br/>
The idea is use this function together with the isValidPHPContentsViaUrl method, where the url called through the isValidPHPContentsViaUrl method will point to this function.<br/>
To be used for request containing code in 'php://input', this is, this method receives $code from POST, create a temp file with it, include file, catch all outputs and at the end returns "1". If echo 1 is the only thing printed, it means the code is correct.<br/>
Note that this function should not return anything bc if there is a php syntax error, apache will stop executing the code at the "include" line and echo the php error.</div>