在sublime text 3中学习PHP,编写PHP代码:
使用的xampp开发环境:
第一步,就是安装xampp,这个没啥可说的,根据自己的系统下载安装就好,我的是OSX;
第二步,就是用XAMPP-manager里manage servers打开apache,不过默认就是run的;
第三步,打开XAMPP里有个htdocs文件夹,新建一个文件夹,比如ajaxdemo;
第四步,在sublime里选project-add folder to project, 选中ajaxdemo就好.
然后就可以测试一下啦,右键ajaxdemo,新建一个file,写一段:
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>test</title> </head> <body> <h1>this is a test: <?php echo"hello world" ?> </h1> </body> </html>
保存成untitled.php, 在浏览器里打开http://localhost/ajaxdemo/untitled.php,
看看是不是输出: this is a test: hello world
显示没错误就没问题啦~接下来就是从基础开始学习PHP之旅了....加油