mirror of
https://github.com/deuill/go-php.git
synced 2024-09-21 08:50:45 +00:00
Simplify README example.y
This commit is contained in:
parent
6fa93f5160
commit
7c4bcb9847
@ -20,20 +20,15 @@ Executing a script is very simple:
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
php "github.com/deuill/go-php"
|
php "github.com/deuill/go-php"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
var b bytes.Buffer
|
|
||||||
|
|
||||||
engine, _ := php.New()
|
engine, _ := php.New()
|
||||||
context, _ := engine.NewContext(&b)
|
context, _ := engine.NewContext(os.Stdout)
|
||||||
|
|
||||||
context.Exec("src/index.php")
|
context.Exec("index.php")
|
||||||
b.WriteTo(os.Stdout)
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user