Skip to content

Commit 4822e05

Browse files
authored
Merge pull request #98 from phel-lang/docs/90-accessing-superglobals
Add Accessing super-globals to PHP Interop page
2 parents abcb1b7 + 1d4ccd3 commit 4822e05

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

content/documentation/php-interop.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,15 @@ title = "PHP Interop"
33
weight = 14
44
+++
55

6+
## Accessing super-globals
7+
8+
Use the `php/` prefix to access the global variables in combination with `get`.
9+
10+
```phel
11+
(get php/$_SERVER "key") # Similar to $_SERVER['key']
12+
(get php/$GLOBAL "argv") # Similar to $GLOBAL['argv']
13+
```
14+
615
## Calling PHP functions
716

817
PHP comes with huge set of functions that can be called from Phel by just adding a `php/` prefix to the function name.

0 commit comments

Comments
 (0)