Creates a <script>
html tag.
script($child, $type, $attr);
Parameter | Required | Default |
---|---|---|
$child | yes | false |
$type | no | 'text/javascript' |
$attr | no | null |
string
Usage:
echo script('alert("Hello World")');
Result:
<script type="text/javascript">
alert("Hello World");
</script>