I've installed wamp64 for windows 10
Apache 2.4.27 PHP 5.6.31 MySQL 5.7.19
I have save my php script like trial.php, but the when I run, localhost/trial.php It came out the whole script.
This typically means the script isn't being processed correctly. This could mean there is something wrong with WAMP or its configuration, or there is something wrong with script or file itself.
As a small FYI, you want to use long PHP tags e.g.
?>. An easy way to see if PHP is even available is to place
<?php phpinfo() ?> in a new PHP file and try to run that rather than a more complex script. Also, if you haven't already done so, you should turn off hiding extensionsfor known file types in Windows. It's possible your script may actually be e.g.
trial.php.txt or similar but Windows is hiding the .txt portion.