mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
a missing word + some CS (no, I'm not an addict)
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@150640 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
fd28c3c371
commit
9ff471e9ac
1 changed files with 7 additions and 7 deletions
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.6 $ -->
|
||||
<!-- $Revision: 1.7 $ -->
|
||||
<reference id="ref.simplexml">
|
||||
<title>SimpleXML functions</title>
|
||||
<titleabbrev>SimpleXML</titleabbrev>
|
||||
|
@ -100,8 +100,8 @@ include 'example.php';
|
|||
$xml = simplexml_load_string($xmlstr);
|
||||
|
||||
/* For each <movie> node, we echo a separate <plot>. */
|
||||
foreach($xml->movie as $movie) {
|
||||
echo $movie->plot,'<br/>';
|
||||
foreach ($xml->movie as $movie) {
|
||||
echo $movie->plot, '<br />';
|
||||
}
|
||||
|
||||
?>
|
||||
|
@ -115,8 +115,8 @@ foreach($xml->movie as $movie) {
|
|||
<simpara>
|
||||
So far, we have only covered the work of reading element names
|
||||
and their values. SimpleXML can also access element attributes.
|
||||
Access attributes of an element just as you would elements of
|
||||
an <type>array</type>.
|
||||
Access attributes of an element just as you would access elements
|
||||
of an <type>array</type>.
|
||||
</simpara>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
|
@ -155,8 +155,8 @@ foreach ($xml->movie[0]->rating as $rating) {
|
|||
include 'example.php';
|
||||
$xml = simplexml_load_string($xmlstr);
|
||||
|
||||
foreach($xml->xpath('//character') as $character) {
|
||||
echo $character->name, 'played by ', $character->actor, '<br/>';
|
||||
foreach ($xml->xpath('//character') as $character) {
|
||||
echo $character->name, 'played by ', $character->actor, '<br />';
|
||||
}
|
||||
?>
|
||||
]]>
|
||||
|
|
Loading…
Reference in a new issue