Home > Backend Development > PHP Tutorial > 在控制台直接应用php

在控制台直接应用php

WBOY
Release: 2016-06-13 10:40:02
Original
783 people have browsed it

在控制台直接使用php

在你编译了PHP(GNU: --with-readline)或者(BSD: --with-libedit)后,你便能够通过使用PHP的-a选项进入这个控制台.

$ php -a

Interactive mode enabled

?

linux下:

php > $a = 1;

php > $b = 2;

php > echo $a + $b;

3

?

php > function foo() {

php { ? ? echo "foo

php " bar";

php { }

php > foo();

?

windows 下

$a = 1;

$b = 2;

echo $a + $b;

注:当退出的时候,执行结果

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template