php: add WIP of PHP

This commit is contained in:
Rico Sta. Cruz 2017-10-10 15:42:00 +08:00
parent 50ac75a1d4
commit fed977fdfd
No known key found for this signature in database
GPG Key ID: CAAD38AE2962619A
1 changed files with 46 additions and 0 deletions

46
wip/php.md Normal file
View File

@ -0,0 +1,46 @@
---
title: PHP
category: Other
layout: 2017/sheet
prism_languages: [php]
---
### Hello world
#### hello.php
```php
<?php
function greetMe($name) {
return "Hello, " . $name . "!";
}
$message = greetMe($name);
echo $message;
```
All PHP files start with `<?php`.
See: [PHP tags](http://php.net/manual/en/language.basic-syntax.phptags.php)
### Objects
```php
<?php
$fruits = array(
"apple" => 20,
"banana" => 30
)
```
### Inspecting objects
```php
<?php
var_dump($object)
```
Prints the contents of a variable for inspection.
See: [var_dump](http://php.net/var_dump)