Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function tag($tag, $content = null, array $attributes = null) {
- $out = '<' . $tag;
- if ($attributes !== null) {
- foreach($attributes AS $key => $val) {
- $out .= ' ' . $key . '="' . $val . '"';
- }
- }
- if ($content === null) {
- return $out . ' />';
- }
- return $out . '>' . $content . '</' . $tag . '>';
- }
- tag('h1', 'Header', array('class' => 'h1', 'id' => 'h1', 'style' => 'text-align:center;'));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement