Welcome Guest, Not a member yet? Register   Sign In
A different heading()
#2

[eluser]xwero[/eluser]
Why not create 2 generic tag functions?
Code:
function container_tag($name,$content='',$attributes='')
{
    $out = '<'.$name;
    if (is_array($attributes)) {
            foreach ($attributes as $k=>$v) {
                $out .= " ".$k."=\"".$v."\"";
            }
        }
    return $out.">".$content."</".$name.">";
}

function empty_tag($name,$attributes='')
{
    $out = '<'.$name;
    if (is_array($attributes)) {
            foreach ($attributes as $k=>$v) {
                $out .= " ".$k."=\"".$v."\"";
            }
        }
    return $out.">";
}
I rather hardcode the html because the use of functions to generate html often require more typing.


Messages In This Thread
A different heading() - by El Forum - 04-24-2009, 09:09 PM
A different heading() - by El Forum - 04-24-2009, 09:50 PM
A different heading() - by El Forum - 04-24-2009, 10:31 PM
A different heading() - by El Forum - 04-25-2009, 03:13 AM
A different heading() - by El Forum - 04-25-2009, 03:36 AM
A different heading() - by El Forum - 04-25-2009, 03:48 AM



Theme © iAndrew 2016 - Forum software by © MyBB