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.
<root> <pages> <page> <title>Home</title> <content>Lorem Ipsum</content> </page> </pages> </root>
<content>「ホーム」を含む変数があるとします。兄弟ノードにあるものを取得したいのですが、次のようなものです。"Get -content- Where -title- = VARIABLE"
<content>
"Get -content- Where -title- = VARIABLE"
foreach ($xml->pages->page as $page) { if ((string) $page->title == 'Home') { return (string) $page->content; } }