Files
2026-07-01 16:44:17 +03:00

43 lines
849 B
PHP

<?php namespace ZN;
/**
* ZN PHP Web Framework
*
* "Simplicity is the ultimate sophistication." ~ Da Vinci
*
* @package ZN
* @license MIT [http://opensource.org/licenses/MIT]
* @author Ozan UYKUN [ozan@znframework.com]
*/
class Hypertext
{
/**
* Sets attributes
*
* @param array $attributes
*
* @return string
*/
public static function attributes(array $attributes) : string
{
$attribute = '';
foreach( $attributes as $key => $values )
{
if( is_numeric($key) )
{
$attribute .= ' '.$values;
}
else
{
if( ! empty($key) )
{
$attribute .= ' '.$key.'="'.$values.'"';
}
}
}
return $attribute;
}
}