| 1 |
# save |
| 2 |
|
| 3 |
```php |
| 4 |
save ( [ string $filepath = '' ] ) : string |
| 5 |
``` |
| 6 |
|
| 7 |
Writes the current node to file. |
| 8 |
|
| 9 |
| Parameter | Description |
| 10 |
| --------- | ----------- |
| 11 |
| `filepath` | Writes to file if the provided file path is not empty. |
| 12 |
|
| 13 |
Returns the document string. |
| 14 |
|
| 15 |
**Examples** |
| 16 |
|
| 17 |
```php |
| 18 |
$string = $node->save(); |
| 19 |
$string = $node->save($file); |
| 20 |
``` |