您现在的位置是:网站首页> 编程资料编程资料
PHP count()函数讲解_php基础_
2023-05-25
294人已围观
简介 PHP count()函数讲解_php基础_
PHP count() 函数
实例
计算 car 节点的子节点个数:
XML; $elem=new SimpleXMLElement($xml); foreach ($elem as $car) { printf("%s has %d children.
", $car['name'], $car->count()); } ?>
定义和用法
count()函数计算指定节点的子节点个数。
语法
count();

总结
以上就是这篇文章的全部内容了,希望本文的内容对大家的学习或者工作具有一定的参考学习价值,谢谢大家对的支持。如果你想了解更多相关内容请查看下面相关链接
您可能感兴趣的文章:
相关内容
- PHP getDocNamespaces()函数讲解_php基础_
- PHP getName()函数讲解_php基础_
- PHP getNamespaces()函数讲解_php基础_
- PHP registerXPathNamespace()函数讲解_php基础_
- PHP children()函数讲解_php基础_
- PHP attributes()函数讲解_php基础_
- PHP asXML()函数讲解_php基础_
- PHP addAttribute()函数讲解_php基础_
- PHP _construct()函数讲解_php基础_
- PHP PDOStatement::setFetchMode讲解_php技巧_
