

新建php文件
1、在htdocs目录下新建一个目录

然后写好的代码怎么运行呢?有三种方式
1、localhost/phpday1/lesson1.php
2、127.0.0.1/phpday1/lesson1.php
3、找到自己电脑的IP地址,比如10.80.1.179
10.80.1.179/php学习/lesson1.php
采用IP地址的方法,别人也能进入这个链接访问
文件的命名必须是.php
php代码写在 <?php ?>中间
<?php
echo "欢迎使用PHP";
?>
网友评论