references:joomla.framework:document:jdocumenthelper-implodeattribsTable of Contents
implodeAttribs
A utility function to implode HTML element attributes from an associative array into a string appropriate for including as part of an XML tag. Syntaxvoid implodeAttribs ( $inner_glue, $outer_glue, $array, $keepOuterKey )
ExamplesExample $array = array( 'attrib1' => 'value1', 'attrib2' => 'value2', 'attrib3' => 'value3', 'arrayattribs' => array( 'attrib4' => 'value4', 'attrib5' => 'value5' ) ); echo "Keeping the outer key: " . JDocumentHelper::implodeAttribs( '=', ' ', $array, true ); echo "Dropping the outer key: " . JDocumentHelper::implodeAttribs( '=', ' ', $array, false ); might produce: Result Keeping the outer key: attrib1="value1" attrib2="value2" attrib3="value3" arrayattribs attrib4="value4" attrib5="value5" Dropping the outer key: attrib1="value1" attrib2="value2" attrib3="value3" attrib4="value4" attrib5="value5" |


