Arr::join

Posted on November 16, 2016

Join array to HTML attributes string.

Example usage

$input = Arr::join([
    'name'  => 'text',
    'type'  => 'text',
    'class' => 'some-css-class',
    'value' => 'here is your value',
]);
echo "<input {$input}>";

// <input name="text" type="text" class="some-css-class" value="here is your value">

Parameters

array $arr array like ‘key’ => ‘value’.

string $pattern join patter.

Return Value

string joined string.

0 Comments

Leave a Reply

Your email address will not be published. Required fields are marked *