cvs: peardoc /en/package/networking/net-mac format.xml
| From: | Andrew Teixeira | Date: | Mon, 01 Jan 2007 16:03:28 +0000 |
| Subject: | cvs: peardoc /en/package/networking/net-mac format.xml | ||
| Groups: | php.pear.doc | ||
| Request: | Send a blank email to pear-doc+get-9188@lists.php.net to get a copy of this message | ||
atex Mon Jan 1 16:03:28 2007 UTC
Modified files:
/peardoc/en/package/networking/net-mac format.xml
Log:
*** empty log message ***
http://cvs.php.net/viewvc.cgi/peardoc/en/package/networking/net-mac/format.xml?r1=1.2&r2=1.3&diff_format=u
Index: peardoc/en/package/networking/net-mac/format.xml
diff -u peardoc/en/package/networking/net-mac/format.xml:1.2
peardoc/en/package/networking/net-mac/format.xml:1.3
--- peardoc/en/package/networking/net-mac/format.xml:1.2 Sun Dec 31 01:06:16 2006
+++ peardoc/en/package/networking/net-mac/format.xml Mon Jan 1 16:03:28 2007
@@ -1,4 +1,4 @@
-<!-- $Revision: 1.2 $ -->
+<!-- $Revision: 1.3 $ -->
<refentry id="package.networking.net-mac.format">
<refnamediv>
<refname>Net_MAC::format()</refname>
@@ -73,12 +73,19 @@
<![CDATA[
require_once "Net/MAC.php";
-$mac = Net_MAC::format("AB:CD:EF:00:11:22");
+$macaddr = 'AB:CD:EF:00:11:22';
+
+if (!Net_MAC::check($macaddr)) {
+ echo "$macaddr is invalid";
+ exit;
+}
+
+$mac = Net_MAC::format($macaddr);
if ($mac) {
echo "$mac";
}
else {
- echo "MAC address is invalid";
+ echo "$macaddr could not be formatted";
}
]]>
</programlisting>
@@ -94,12 +101,19 @@
<![CDATA[
require_once "Net/MAC.php";
-$mac = Net_MAC::format("AB:CD:EF:00:11:22", '-');
+$macaddr = 'AB:CD:EF:00:11:22';
+
+if (!Net_MAC::check($macaddr)) {
+ echo "$macaddr is invalid";
+ exit;
+}
+
+$mac = Net_MAC::format($macaddr, '-');
if ($mac) {
echo "$mac";
}
else {
- echo "MAC address is invalid";
+ echo "$macaddr could not be formatted";
}
]]>
</programlisting>
@@ -115,12 +129,19 @@
<![CDATA[
require_once "Net/MAC.php";
-$mac = Net_MAC::format("AB:CD:EF:00:11:22", '', true);
+$macaddr = 'ab:cd:ef:00:11:22';
+
+if (!Net_MAC::check($macaddr)) {
+ echo "$macaddr is invalid";
+ exit;
+}
+
+$mac = Net_MAC::format($macaddr, '', true);
if ($mac) {
echo "$mac";
}
else {
- echo "MAC address is invalid";
+ echo "$macaddr could not be formatted";
}
]]>
</programlisting>
@@ -129,7 +150,13 @@
<screen>ABCDEF001122</screen>
</para>
</example>
- </refsect1>
+ </refsect1>
+ <refsect1 id="package.networking.net-mac.format.see">
+ &title.see;
+ <para>
+ <link
linkend="package.networking.net-mac.check"><function>Net_MAC::check</function></link>,
+ </para>
+ </refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables: