philip          Fri May 30 14:07:51 2003 EDT

  Modified files:              
    /phpdoc/en/reference/array/functions        in-array.xml 
  Log:
  Added {braces} and php tags to the examples.
  
  
Index: phpdoc/en/reference/array/functions/in-array.xml
diff -u phpdoc/en/reference/array/functions/in-array.xml:1.5 
phpdoc/en/reference/array/functions/in-array.xml:1.6
--- phpdoc/en/reference/array/functions/in-array.xml:1.5        Fri Aug  9 19:14:01 
2002
+++ phpdoc/en/reference/array/functions/in-array.xml    Fri May 30 14:07:51 2003
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.5 $ -->
+<!-- $Revision: 1.6 $ -->
 <!-- splitted from ./en/functions/array.xml, last change in rev 1.56 -->
   <refentry id="function.in-array">
    <refnamediv>
@@ -42,6 +42,7 @@
       <title><function>in_array</function> example</title>
       <programlisting role="php">
 <![CDATA[
+<?php
 $os = array ("Mac", "NT", "Irix", "Linux");
 if (in_array ("Irix", $os)) {
     print "Got Irix";
@@ -49,6 +50,7 @@
 if (in_array ("mac", $os)) {
     print "Got mac";
 }
+?>
 ]]>
       </programlisting>
       <para>
@@ -70,10 +72,13 @@
 <?php
 $a = array('1.10', 12.4, 1.13);
 
-if (in_array('12.4', $a, TRUE))
+if (in_array('12.4', $a, TRUE)) {
     echo "'12.4' found with strict check\n";
-if (in_array(1.13, $a, TRUE))
+}
+
+if (in_array(1.13, $a, TRUE)) {
     echo "1.13 found with strict check\n";
+}
 ?>
 ]]>
       </programlisting>
@@ -95,18 +100,23 @@
 <?php
 $a = array(array('p', 'h'), array('p', 'r'), 'o');
 
-if (in_array(array ('p', 'h'), $a))
+if (in_array(array ('p', 'h'), $a)) {
     echo "'ph' was found\n";
-if (in_array(array ('f', 'i'), $a))
+}
+
+if (in_array(array ('f', 'i'), $a)) {
     echo "'fi' was found\n";
-if (in_array('o', $a))
-    echo "'o' was found\n";
-?>
+}
 
-// This will output:
+if (in_array('o', $a)) {
+    echo "'o' was found\n";
+}
 
-'ph' was found
-'o' was found
+/* Outputs:
+  'ph' was found
+  'o' was found
+*/
+?>
 ]]>
       </programlisting>
      </example>



-- 
PHP Documentation Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to