Skip to content

Commit 34f1770

Browse files
committed
README tweaks
1 parent 7b661d9 commit 34f1770

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

README.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,21 @@ php.inputString('This is a string of data provided on STDIN.');
310310
const exitCode = await php.run('<?php echo "Hello, world!";');
311311
```
312312
313+
### Dynamic Extensions in Static Pages
314+
315+
Dynamic extensions can be loaded in static webpages like so:
316+
317+
```html
318+
<script async type = "module" src = "https://cdn.jsdelivr.net/npm/php-wasm@0.0.9-alpha-12/php-tags.mjs"></script>
319+
320+
<script type = "text/php" data-stdout = "#output" data-stderr = "#error" data-libs = '[
321+
{"url": "https://unpkg.com/php-wasm-yaml/php8.3-yaml.so", "ini": true},
322+
{"url": "https://unpkg.com/php-wasm-yaml/libyaml.so", "ini": false}
323+
]'><?php
324+
print yaml_emit([1,2,3,"string",["k1" => "value", "k2" => "value2", "k3" => "value3"],"now" => date("Y-m-d h:i:s")]);
325+
</script>
326+
```
327+
313328
## ⚙️ Configuration
314329
315330
You can pass in the `ini` property to the constructor to add lines to `/php.ini`:
@@ -415,7 +430,7 @@ The above is actually shorthand for the following code. Passing `ini: true` will
415430
```javascript
416431
const php = new PhpWeb({sharedLibs: [
417432
{
418-
name: `php8.3-xml.so`,
433+
name: `php8.3-phar.so`,
419434
url: `https://unpkg.com/php-wasm-phar/php8.3-phar.so`,
420435
ini: true,
421436
}

0 commit comments

Comments
 (0)