Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
オプションの XML データに対してある種のループを実行しようとしています。
ノードは潜在的に次のようになります。
<link1> <url>http://www.bleh.com</url> <text>Click here</text> </link1> <link2> <url>bleh.com</url> <text>Click here</text> </link2>
これらのノードが存在するかどうかを判断し、それに応じて解析するための最良の方法は何ですか?
SimpleXML を使用している場合は、単純に isset() を使用して、ノードが存在するかどうかを判断できます。