PHP ve XML ile ilgili bir başka soru ...
O orada çocuk içeriğine dayalı çocukları dışlamak için doktorunun olduğunu.
See the example below: If "title" contains the word "XTRA:" I don't want this "movie" to be listed.
This is my PHP code:
<? $xml = simplexml_load_file("movies.xml");
foreach ($xml->movie as $movie){ ?>
<h2><? echo $movie->title ?></h2>
<p>Year: <? echo $movie->year ?></p>
<? } ?>
This is mys XML file:
<?xml version="1.0" encoding="UTF-8"?>
<movies>
<movie>
<title>Little Fockers</title>
<year>2010</year>
</movie>
<movie>
<title>Little Fockers XTRA: teaser 3</title>
<year>2010</year>
</movie>
</movies>
The outcome of the code above is:
<h2>Little Fockers</h2>
<p>Year: 2010</p>
<h2>Little Fockers XTRA: teaser 3</h2>
<p>Year: 2010</p>
I want it to be only:
<h2>Little Fockers</h2>
<p>Year: 2010</p>