<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></title> 
<link>http://www.jackxiang.com/index.php</link> 
<description><![CDATA[赢在IT，Playin' with IT,Focus on Killer Application,Marketing Meets Technology.]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></copyright>
<item>
<link>http://www.jackxiang.com/post//</link>
<title><![CDATA[class_exists() 与get_class_methods()函数使用实例]]></title> 
<author>jack &lt;xdy108@126.com&gt;</author>
<category><![CDATA[WEB2.0]]></category>
<pubDate>Wed, 27 Aug 2008 03:57:49 +0000</pubDate> 
<guid>http://www.jackxiang.com/post//</guid> 
<description>
<![CDATA[ 
	[blockquote]&lt;html&gt;<br/>&lt;head&gt;<br/>&lt;title&gt;class_exists()函数使用实例&lt;/title&gt;<br/>&lt;/head&gt;<br/>&lt;body&gt;<br/>&lt;?<br/>class Window&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//首先定义一个类<br/>{<br/>var $state;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//窗户的状态<br/>function close_window()&nbsp;&nbsp;&nbsp;&nbsp;//关窗户方法<br/>{<br/>&nbsp;&nbsp;$this-&gt;state=&quot;close&quot;;&nbsp;&nbsp;&nbsp;&nbsp;//窗户的状态为关<br/>}<br/>function open_window()&nbsp;&nbsp;&nbsp;&nbsp;//开窗户方法<br/>{<br/>&nbsp;&nbsp;$this-&gt;state=&quot;open&quot;;&nbsp;&nbsp;&nbsp;&nbsp;//窗户的状态为开<br/>}<br/>}<br/>class Who_Window extends Window&nbsp;&nbsp;//创建子类<br/>{<br/>var $owner;<br/>function close_window()&nbsp;&nbsp;&nbsp;&nbsp;//方法继承<br/>{<br/>&nbsp;&nbsp;$this-&gt;state=&quot;close&quot;;<br/>&nbsp;&nbsp;$this-&gt;owner=&quot;Jack&quot;;<br/>}<br/>}<br/>function f_e($string)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//创建一个基于class_exists()的自定义函数<br/>{<br/>if(class_exists($string))&nbsp;&nbsp;&nbsp;&nbsp;//如果类名存在<br/>{<br/>&nbsp;&nbsp;echo &quot;名为&quot;.$string.&quot;的类已经存在！&quot;; //打印相应信息<br/>}<br/>else&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//如果类不存在<br/>{<br/>&nbsp;&nbsp;echo &quot;名为&quot;.$string.&quot;的类并不存在！&quot;; //打印相应信息<br/>}<br/>}<br/>f_e(&quot;Window&quot;);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//调用函数<br/>echo &quot;&lt;p&gt;&quot;;<br/>f_e(&quot;Who_Window&quot;);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//调用函数<br/>echo &quot;&lt;p&gt;&quot;;<br/>f_e(&quot;temp_class&quot;);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//调用函数<br/>echo &quot;&lt;p&gt;&quot;;<br/>?&gt;<br/>&lt;/body&gt;<br/>&lt;/html&gt;[/blockquote]<br/><br/><br/>Copy code<br/>[blockquote]&lt;html&gt;<br/>&lt;head&gt;<br/>&lt;title&gt;get_class_methods()函数使用实例&lt;/title&gt;<br/>&lt;/head&gt;<br/>&lt;body&gt;<br/>&lt;?<br/>class Window&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//首先定义一个类<br/>{<br/>&nbsp;&nbsp;&nbsp;&nbsp;var $state;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//窗户的状态<br/>&nbsp;&nbsp;&nbsp;&nbsp;function close_window()&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//关窗户方法<br/>&nbsp;&nbsp;&nbsp;&nbsp;{<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$this-&gt;state=&quot;close&quot;;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//窗户的状态为关<br/>&nbsp;&nbsp;&nbsp;&nbsp;}<br/>&nbsp;&nbsp;&nbsp;&nbsp;function open_window()&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//开窗户方法<br/>&nbsp;&nbsp;&nbsp;&nbsp;{<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$this-&gt;state=&quot;open&quot;;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//窗户的状态为开<br/>&nbsp;&nbsp;&nbsp;&nbsp;}<br/>}<br/>$temp=get_class_methods(&quot;Window&quot;);<br/>echo &quot;类Window中的方法有以下几个：&quot;;<br/>echo &quot;&lt;p&gt;&quot;;<br/>for($i=0;$i&lt;count($temp);$i++)<br/>{<br/>&nbsp;&nbsp;&nbsp;&nbsp;echo $temp[$i].&quot;，&quot;;<br/>}<br/>?&gt;<br/>&lt;/body&gt;<br/>&lt;/html&gt;[/blockquote]
]]>
</description>
</item><item>
<link>http://www.jackxiang.com/post//#blogcomment</link>
<title><![CDATA[[评论] class_exists() 与get_class_methods()函数使用实例]]></title> 
<author> &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate> 
<guid>http://www.jackxiang.com/post//#blogcomment</guid> 
<description>
<![CDATA[ 
	
]]>
</description>
</item>
</channel>
</rss>