Update README.md
Add syntax highlighting to make the code blocks more readable.
This commit is contained in:
parent
52df8947dc
commit
87a09f15a8
|
@ -39,12 +39,13 @@ PH7 in 5 Minutes or Less
|
||||||
Here is what you do to start experimenting with the PH7 engine without having to do a lot of tedious reading and configuration:
|
Here is what you do to start experimenting with the PH7 engine without having to do a lot of tedious reading and configuration:
|
||||||
|
|
||||||
Below is a simple C program that demonstrates how to use the C/C++ interface to PH7. This program compile and execute the following PHP script:
|
Below is a simple C program that demonstrates how to use the C/C++ interface to PH7. This program compile and execute the following PHP script:
|
||||||
|
```php
|
||||||
<?php
|
<?php
|
||||||
echo 'Welcome guest'.PHP_EOL;
|
echo 'Welcome guest'.PHP_EOL;
|
||||||
echo 'Current system time is: '.date('Y-m-d H:i:s').PHP_EOL;
|
echo 'Current system time is: '.date('Y-m-d H:i:s').PHP_EOL;
|
||||||
echo 'and you are running '.php_uname();
|
echo 'and you are running '.php_uname();
|
||||||
?>
|
?>
|
||||||
|
```
|
||||||
|
|
||||||
That is, this simple PHP script when running should display a greeting message, the current system time and the host operating system. A typical output of this program would look like this:
|
That is, this simple PHP script when running should display a greeting message, the current system time and the host operating system. A typical output of this program would look like this:
|
||||||
|
|
||||||
|
@ -54,9 +55,7 @@ That is, this simple PHP script when running should display a greeting message,
|
||||||
|
|
||||||
Here is the C code. Note that you can get a working version of this program [here](http://www.symisc.net/downloads/ph7_intro.c):
|
Here is the C code. Note that you can get a working version of this program [here](http://www.symisc.net/downloads/ph7_intro.c):
|
||||||
|
|
||||||
|
```c
|
||||||
|
|
||||||
|
|
||||||
/* Compile this file together with the ph7 engine source code to generate
|
/* Compile this file together with the ph7 engine source code to generate
|
||||||
* the executable. For example:
|
* the executable. For example:
|
||||||
* gcc -W -Wall -O6 -o ph7_test ph7_intro.c ph7.c
|
* gcc -W -Wall -O6 -o ph7_test ph7_intro.c ph7.c
|
||||||
|
@ -200,6 +199,7 @@ Here is the C code. Note that you can get a working version of this program [her
|
||||||
ph7_release(pEngine);
|
ph7_release(pEngine);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
We create a new [PH7 engine instance](http://ph7.symisc.net/c_api_func.html#ph7_init) using a call to [ph7_init()](http://ph7.symisc.net/c_api_func.html#ph7_init) on line 86. This is often the first PH7 API call that an application makes and is a prerequisite in order to compile PHP code using one of the compile interfaces.
|
We create a new [PH7 engine instance](http://ph7.symisc.net/c_api_func.html#ph7_init) using a call to [ph7_init()](http://ph7.symisc.net/c_api_func.html#ph7_init) on line 86. This is often the first PH7 API call that an application makes and is a prerequisite in order to compile PHP code using one of the compile interfaces.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user