In the php file, write header('content-type:text/html;charset = uft-8');
<?php header('content-type:text/html;charset=utf-8'); echo"hello world 中文"; function sum($a,$b){ return '<div style = "color : red">'.($a+$b).'</div>'; } echo sum(1,2); ?>
Put the written php file in the www directory to display the loading.
When previewing the local file, enter the 127.0.0.1/php file in the browser; it can be loaded, or enter the localhost:80/php file in the browser;
modify the port, left-click on httpd:conf in Apache under wamp operation, and query listen port is modified. Anything with # is a comment. Restart all services is required after modification.