note 86777 deleted from function.xml-parse-into-struct by cmb
| From: | cmb@php.net | Date: | Sun, 06 Oct 2019 08:29:37 +0000 |
| Subject: | note 86777 deleted from function.xml-parse-into-struct by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-212529@lists.php.net to get a copy of this message | ||
Note Submitter: lpatrick
----
@ dale at ucsc dot edu
I modified your code for entries like <caption>Value</caption>
<?php
$o='';
foreach( $vals as $tag ){
//tab space:
for($i=1; $i < $tag['level'];$i++)
$o.="\t";
if($tag['type']!='close'){
if($tag['type']!='cdata')
$o.='<'.$tag['tag'];
if(isset($tag['attributes'])){
foreach($tag['attributes'] as $attr=>$aval){
$o.=' '.$attr.'="'.$aval.'"';
}
}
if($tag['type']!='cdata'){
$o.=($tag['type']=='complete' && (!isset($tag['value']) ||
$tag['value']==''))?'/>':'>';
}
$o.=(isset($tag['value']))?$tag['value']:'';
if($tag['type']!='cdata'){
$o.=($tag['type']=='complete' && (isset($tag['value'])
&&
$tag['value']<>''))?'</'.$tag['tag'].'>':'';
}
$o.="\n";
}else{
$o.='</'.$tag['tag'].'>'."\n";
}
}
?>