<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>مدونة مبرمج مغربي &#187; function</title>
	<atom:link href="http://www.bp.ma/tag/function/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.bp.ma</link>
	<description>مدونة برمجية اقوم باضافة اخر ما ابرمجه من برمجيات حرة ودروس واخبار تقنية</description>
	<lastBuildDate>Thu, 12 Aug 2010 11:12:39 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>ما معنى دالة وكيف يتم انشائها واستخدامها</title>
		<link>http://www.bp.ma/2009/07/10/%d9%85%d8%a7-%d9%85%d8%b9%d9%86%d9%89-%d8%af%d8%a7%d9%84%d8%a9-%d9%88%d9%83%d9%8a%d9%81-%d9%8a%d8%aa%d9%85-%d8%a7%d9%86%d8%b4%d8%a7%d8%a6%d9%87%d8%a7-%d9%88%d8%a7%d8%b3%d8%aa%d8%ae%d8%af%d8%a7%d9%85/</link>
		<comments>http://www.bp.ma/2009/07/10/%d9%85%d8%a7-%d9%85%d8%b9%d9%86%d9%89-%d8%af%d8%a7%d9%84%d8%a9-%d9%88%d9%83%d9%8a%d9%81-%d9%8a%d8%aa%d9%85-%d8%a7%d9%86%d8%b4%d8%a7%d8%a6%d9%87%d8%a7-%d9%88%d8%a7%d8%b3%d8%aa%d8%ae%d8%af%d8%a7%d9%85/#comments</comments>
		<pubDate>Fri, 10 Jul 2009 10:38:37 +0000</pubDate>
		<dc:creator>عبد الواحد البشيري</dc:creator>
				<category><![CDATA[php  البي اتش بي]]></category>
		<category><![CDATA[دروس برمجية]]></category>
		<category><![CDATA[function]]></category>
		<category><![CDATA[انشاء]]></category>
		<category><![CDATA[تعلم]]></category>
		<category><![CDATA[دالة]]></category>
		<category><![CDATA[وظيفة]]></category>

		<guid isPermaLink="false">http://www.bp.ma/?p=360</guid>
		<description><![CDATA[بسم الله الرحمن الرحيم الدالة او الوظيفة وجهان لعملة واحدة حيث يتم الاستفادة من الدالة في امور كثيرة في البرنامج الذي نبرمجه لغة php هي اصلا تعتمد على الدوال او الوظائف هذه الدوال مكتوبة بالغة التي كتبت بها لغة php حيث تتعد وظائفها من التأكد من الأرقام والنصوص وهكذا... الدالة عبارة عن وظيفة تقوم بعملها [...]]]></description>
			<content:encoded><![CDATA[<p>بسم الله الرحمن الرحيم</p>
<p>الدالة او الوظيفة وجهان لعملة واحدة حيث يتم الاستفادة من الدالة في امور كثيرة في البرنامج الذي نبرمجه<br />
لغة php هي اصلا تعتمد على الدوال او الوظائف هذه الدوال مكتوبة بالغة التي كتبت بها لغة php حيث تتعد وظائفها من التأكد من الأرقام  والنصوص  وهكذا...</p>
<p>الدالة عبارة عن وظيفة تقوم بعملها مثلا بحكم  ان مهنتي الخياطة فان الة الخياطة تعتبر دالة لماذا ؟ سأشرحها بالتفصيل<br />
<span id="more-360"></span></p>
<p>الة الخياطة تأخذ متغيرين وهما الخيط الذي يظهر فوق القماش والخيط الذي يظهر اسفله<br />
لنفرض ان الخيط الأسفل احمر والخيط الذي يظهر فوق لونه اخضر الأن سنقوم بخياطة القماش  وعند الانتهاء سنرى ان الثوب من فوق لون المسار الذي اتبعته الة الخياطة<br />
لونه اخضر ومن الأسفل  لونه احمر</p>
<p>اذا الة الماكينة دالة<br />
الأن مثال برمجي<br />
سننشئ دالة تحمل متغيرين  وهما الألوان</p>
<div class="igBar"><span id="lphp-5"><a href="#" onclick="javascript:showPlainTxt('php-5'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-5">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">function</span> txt_color<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$color1</span>,<span style="color:#0000FF;">$color2</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">"&lt;div style='background:"</span>.<span style="color:#0000FF;">$color1</span>.<span style="color:#FF0000;">";color:"</span>.<span style="color:#0000FF;">$color2</span>.<span style="color:#FF0000;">"'&gt;تجربة اظهار النص والخلفية بلونين مختلفين&lt;/div&gt;"</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>وطريقة استخدام الدالة</p>
<div class="igBar"><span id="lphp-6"><a href="#" onclick="javascript:showPlainTxt('php-6'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-6">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">txt_color<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'red'</span>,<span style="color:#FF0000;">'green'</span><span style="color:#006600; font-weight:bold;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>الأن ماذا لو اردن تغيير النص بشكل دينامكي حسب حاجتنا دون التعديل على الدالة في كل مرة</p>
<p>تعمدت في المثال النظري فوق عدم ذكر متغير اخر تحمله الة الخياطة ... انه الثوب فهو يتغير في كل مرة مثله مثل الخيط</p>
<p>اذا الدالة البرمجية ستحمل ثلاث متغيرات وهما<br />
لون الخلفية<br />
لون النص<br />
النص</p>
<p>وستكون هكذا</p>
<div class="igBar"><span id="lphp-7"><a href="#" onclick="javascript:showPlainTxt('php-7'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-7">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">function</span> txt_color<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$color1</span>,<span style="color:#0000FF;">$color2</span>,<span style="color:#0000FF;">$txt</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">"&lt;div style='background:"</span>.<span style="color:#0000FF;">$color1</span>.<span style="color:#FF0000;">";color:"</span>.<span style="color:#0000FF;">$color2</span>.<span style="color:#FF0000;">"'&gt;"</span>.<span style="color:#0000FF;">$txt</span>.<span style="color:#FF0000;">"&lt;/div&gt;"</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>وطريقة استخدام الدالة</p>
<div class="igBar"><span id="lphp-8"><a href="#" onclick="javascript:showPlainTxt('php-8'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-8">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">txt_color<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'red'</span>,<span style="color:#FF0000;">'green'</span>,<span style="color:#FF0000;">'تجربة اظهار النص والخلفية بلونين مختلفين'</span><span style="color:#006600; font-weight:bold;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>هذه فان اخطأت فمن نفسي والشيطان وان اصبت فمن الله عز وجل</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bp.ma/2009/07/10/%d9%85%d8%a7-%d9%85%d8%b9%d9%86%d9%89-%d8%af%d8%a7%d9%84%d8%a9-%d9%88%d9%83%d9%8a%d9%81-%d9%8a%d8%aa%d9%85-%d8%a7%d9%86%d8%b4%d8%a7%d8%a6%d9%87%d8%a7-%d9%88%d8%a7%d8%b3%d8%aa%d8%ae%d8%af%d8%a7%d9%85/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>دالة ارسال  البريد الالكتروني الى الوارد وليس الى الرسائل المزعجة</title>
		<link>http://www.bp.ma/2009/06/20/%d8%af%d8%a7%d9%84%d8%a9-%d8%a7%d8%b1%d8%b3%d8%a7%d9%84%d8%a9-%d8%a7%d9%84%d8%a8%d8%b1%d9%8a%d8%af-%d8%a7%d9%84%d8%a7%d9%84%d9%83%d8%aa%d8%b1%d9%88%d9%86%d9%8a-%d8%a7%d9%84%d9%89-%d8%a7%d9%84%d9%88/</link>
		<comments>http://www.bp.ma/2009/06/20/%d8%af%d8%a7%d9%84%d8%a9-%d8%a7%d8%b1%d8%b3%d8%a7%d9%84%d8%a9-%d8%a7%d9%84%d8%a8%d8%b1%d9%8a%d8%af-%d8%a7%d9%84%d8%a7%d9%84%d9%83%d8%aa%d8%b1%d9%88%d9%86%d9%8a-%d8%a7%d9%84%d9%89-%d8%a7%d9%84%d9%88/#comments</comments>
		<pubDate>Sat, 20 Jun 2009 08:42:36 +0000</pubDate>
		<dc:creator>عبد الواحد البشيري</dc:creator>
				<category><![CDATA[php  البي اتش بي]]></category>
		<category><![CDATA[دروس برمجية]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[function]]></category>
		<category><![CDATA[mail]]></category>
		<category><![CDATA[no spam]]></category>
		<category><![CDATA[send]]></category>
		<category><![CDATA[ارسال]]></category>
		<category><![CDATA[البريد]]></category>
		<category><![CDATA[دالة]]></category>
		<category><![CDATA[سبام]]></category>

		<guid isPermaLink="false">http://www.bp.ma/?p=342</guid>
		<description><![CDATA[بسم الله الرحمن الرحيم كما في العنوان فان الرسالة تصل مباشرة الى صفحة الرسائل لا تستخدم هذه الدالة في ما يغضب الله PLAIN TEXT PHP: function send_mail&#40;$to,$from,$subject,$msg&#41;&#123; &#160; &#160; /* &#160; &#160; function name : send_mail &#160; &#160; author&#160; &#160; &#160; &#160; : abdelouahid el bachiri &#160; &#160; email&#160; &#160; &#160; &#160; &#160;: elbachiri @ [...]]]></description>
			<content:encoded><![CDATA[<p>بسم الله الرحمن الرحيم</p>
<p>كما في العنوان فان الرسالة تصل مباشرة الى صفحة الرسائل</p>
<p>لا تستخدم هذه الدالة في ما يغضب الله</p>
<div class="igBar"><span id="lphp-11"><a href="#" onclick="javascript:showPlainTxt('php-11'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-11">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">function</span> send_mail<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$to</span>,<span style="color:#0000FF;">$from</span>,<span style="color:#0000FF;">$subject</span>,<span style="color:#0000FF;">$msg</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#008000;">/*</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">&nbsp; &nbsp; function name : send_mail</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">&nbsp; &nbsp; author&nbsp; &nbsp; &nbsp; &nbsp; : abdelouahid el bachiri</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">&nbsp; &nbsp; email&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;: elbachiri @ gmail . com</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">&nbsp; &nbsp; site&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; : www.bp.ma</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">&nbsp; &nbsp; date&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; : 20.06.2009 09:38:29</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">&nbsp; &nbsp; */</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#0000FF;">$headers</span> =<span style="color:#FF0000;">"MIME-Version: 1.0 <span style="color:#000099; font-weight:bold;">\r</span><span style="color:#000099; font-weight:bold;">\n</span>"</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#0000FF;">$headers</span>.=<span style="color:#FF0000;">"from: $from&nbsp; $subject&nbsp; <span style="color:#000099; font-weight:bold;">\r</span><span style="color:#000099; font-weight:bold;">\n</span>"</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#0000FF;">$headers</span>.=<span style="color:#FF0000;">"Content-type: text/html;charset=utf-8 <span style="color:#000099; font-weight:bold;">\r</span><span style="color:#000099; font-weight:bold;">\n</span>"</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#0000FF;">$headers</span>.=<span style="color:#FF0000;">"X-Priority: 3<span style="color:#000099; font-weight:bold;">\r</span><span style="color:#000099; font-weight:bold;">\n</span>"</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#0000FF;">$headers</span>.=<span style="color:#FF0000;">"X-Mailer: smail-PHP "</span>.<a href="http://www.php.net/phpversion"><span style="color:#000066;">phpversion</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#FF0000;">"<span style="color:#000099; font-weight:bold;">\r</span><span style="color:#000099; font-weight:bold;">\n</span>"</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#0000FF;">$msg</span>&nbsp; &nbsp; =<span style="color:#FF0000;">'</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF0000;">&nbsp; &nbsp; &lt;div style=&quot;text-align:right&quot;&gt;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF0000;">&nbsp; &nbsp; &lt;h2&gt;'</span>.<span style="color:#0000FF;">$subject</span>.<span style="color:#FF0000;">'&lt;/h2&gt;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF0000;">&nbsp; &nbsp; '</span>.<span style="color:#0000FF;">$msg</span>.<span style="color:#FF0000;">'</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF0000;">&nbsp; &nbsp; &lt;/div&gt;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF0000;">&nbsp; &nbsp; '</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#616100;">if</span><span style="color:#006600; font-weight:bold;">&#40;</span> <a href="http://www.php.net/mail"><span style="color:#000066;">mail</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$to</span>,<span style="color:#0000FF;">$subject</span>,<span style="color:#0000FF;">$msg</span>,<span style="color:#0000FF;">$headers</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#616100;">return</span> <span style="color:#000000; font-weight:bold;">true</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#616100;">else</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#616100;">return</span> <span style="color:#000000; font-weight:bold;">false</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>طريقة الاستخدام</p>
<div class="igBar"><span id="lphp-12"><a href="#" onclick="javascript:showPlainTxt('php-12'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-12">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$to</span>&nbsp; =<span style="color:#FF0000;">"example@example.com"</span>; <span style="color:#FF9933; font-style:italic;">// البريد الذي سيستقبل الرسالة</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$from</span>=<span style="color:#FF0000;">"from@example.com"</span>; <span style="color:#FF9933; font-style:italic;">// البريد المرسل</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$subject</span>=<span style="color:#FF0000;">"عنوان الرسالة"</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$text</span>&nbsp; &nbsp;=<span style="color:#FF0000;">"نص الرسالة"</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#616100;">if</span><span style="color:#006600; font-weight:bold;">&#40;</span> send_mail<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$to</span>,<span style="color:#0000FF;">$from</span>,<span style="color:#0000FF;">$subject</span>,<span style="color:#0000FF;">$text</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">'تم ارسالة الرسالة بنجاح'</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#616100;">else</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">'لم يتم ارسال الرسالة'</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>هذه فان اخطأت فمن نفسي والشيطان وان اصبت  فمن الله عز وجل</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bp.ma/2009/06/20/%d8%af%d8%a7%d9%84%d8%a9-%d8%a7%d8%b1%d8%b3%d8%a7%d9%84%d8%a9-%d8%a7%d9%84%d8%a8%d8%b1%d9%8a%d8%af-%d8%a7%d9%84%d8%a7%d9%84%d9%83%d8%aa%d8%b1%d9%88%d9%86%d9%8a-%d8%a7%d9%84%d9%89-%d8%a7%d9%84%d9%88/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>مستندات التعامل مع php و mysql بروابط مباشرة ودائمة</title>
		<link>http://www.bp.ma/2009/06/05/%d9%85%d8%b3%d8%aa%d9%86%d8%af%d8%a7%d8%aa-%d8%a7%d9%84%d8%aa%d8%b9%d8%a7%d9%85%d9%84-%d9%85%d8%b9-php-%d9%88-mysql-%d8%a8%d8%b1%d9%88%d8%a7%d8%a8%d8%b7-%d9%85%d8%a8%d8%a7%d8%b4%d8%b1%d8%a9-%d9%88/</link>
		<comments>http://www.bp.ma/2009/06/05/%d9%85%d8%b3%d8%aa%d9%86%d8%af%d8%a7%d8%aa-%d8%a7%d9%84%d8%aa%d8%b9%d8%a7%d9%85%d9%84-%d9%85%d8%b9-php-%d9%88-mysql-%d8%a8%d8%b1%d9%88%d8%a7%d8%a8%d8%b7-%d9%85%d8%a8%d8%a7%d8%b4%d8%b1%d8%a9-%d9%88/#comments</comments>
		<pubDate>Fri, 05 Jun 2009 07:13:01 +0000</pubDate>
		<dc:creator>عبد الواحد البشيري</dc:creator>
				<category><![CDATA[php  البي اتش بي]]></category>
		<category><![CDATA[download]]></category>
		<category><![CDATA[function]]></category>
		<category><![CDATA[functions]]></category>
		<category><![CDATA[manual]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[تحميل]]></category>
		<category><![CDATA[دوال]]></category>
		<category><![CDATA[مستند]]></category>

		<guid isPermaLink="false">http://www.bp.ma/?p=338</guid>
		<description><![CDATA[بسم الله الرحمن الرحيم هذا رابط تحميل مستند التعامل مع جميع دوال php والمستند تستطيع اختيار نوعه سواءا html اوchm اللغات الداعمة لهذا المستند English Bulgarian Brazilian Portuguese French German Japanese Korean sdPolish Romanian Russian Spanish Turkish اما اللغة العربية فالعرب نائمون اما هذا الرابط فهو للتعامل مع دوال mysql 6 كذالك تستطيع تحميل  المستند [...]]]></description>
			<content:encoded><![CDATA[<p>بسم الله الرحمن الرحيم</p>
<p>هذا <a href="http://www.php.net/download-docs.php">رابط</a> تحميل مستند التعامل مع جميع دوال php والمستند تستطيع اختيار نوعه سواءا html اوchm</p>
<p>اللغات الداعمة لهذا المستند</p>
<ul>
<li>English</li>
<li>Bulgarian</li>
<li>Brazilian Portuguese</li>
<li>French</li>
<li>German</li>
<li>Japanese</li>
<li>Korean</li>
<li>sdPolish</li>
<li>Romanian</li>
<li>Russian</li>
<li>Spanish</li>
<li>Turkish</li>
</ul>
<p>اما اللغة العربية فالعرب نائمون</p>
<p>اما هذا <a href="http://downloads.mysql.com/docs/refman-6.0-en.chm">الرابط</a> فهو للتعامل مع دوال mysql 6  كذالك تستطيع تحميل  المستند باي نوع ترتاح له في القراءة</p>
<p>كما يمكنك اختيار اي نسخة من mysql من <a href="http://dev.mysql.com/doc/">هنا</a></p>
<p>هذا فان اخطأت فمن نفسي والشيطان وان اصبت فمن الله عز وجل</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bp.ma/2009/06/05/%d9%85%d8%b3%d8%aa%d9%86%d8%af%d8%a7%d8%aa-%d8%a7%d9%84%d8%aa%d8%b9%d8%a7%d9%85%d9%84-%d9%85%d8%b9-php-%d9%88-mysql-%d8%a8%d8%b1%d9%88%d8%a7%d8%a8%d8%b7-%d9%85%d8%a8%d8%a7%d8%b4%d8%b1%d8%a9-%d9%88/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>دالة انشاء نص عشوائي</title>
		<link>http://www.bp.ma/2009/06/04/%d8%af%d8%a7%d9%84%d8%a9-%d8%a7%d9%86%d8%b4%d8%a7%d8%a1-%d9%86%d8%b5-%d8%b9%d8%b4%d9%88%d8%a7%d8%a6%d9%8a/</link>
		<comments>http://www.bp.ma/2009/06/04/%d8%af%d8%a7%d9%84%d8%a9-%d8%a7%d9%86%d8%b4%d8%a7%d8%a1-%d9%86%d8%b5-%d8%b9%d8%b4%d9%88%d8%a7%d8%a6%d9%8a/#comments</comments>
		<pubDate>Thu, 04 Jun 2009 09:56:51 +0000</pubDate>
		<dc:creator>عبد الواحد البشيري</dc:creator>
				<category><![CDATA[php  البي اتش بي]]></category>
		<category><![CDATA[function]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[random]]></category>
		<category><![CDATA[short]]></category>
		<category><![CDATA[shortcut]]></category>
		<category><![CDATA[دالة]]></category>
		<category><![CDATA[عشوائي]]></category>

		<guid isPermaLink="false">http://www.bp.ma/?p=332</guid>
		<description><![CDATA[بسم الله الرحمن الرحيم الدالة بسيطة ولكنها مفيدة جدا لانشاء كلمات المرور العشوائية او استخدمها في اختصار الروابط الذي اعمل عليه حاليا الدالة تأخد براميتر واحد غير الزامي اي اذا كتبت رقم 6 داخل الدالة سيطبع 6 حروف اما اذا كتبت الدالة بدون برامتر ستطبع الرقم الافتراض وهو 2 حروف PLAIN TEXT PHP: function short&#40;$number='2'&#41;&#123; [...]]]></description>
			<content:encoded><![CDATA[<p>بسم الله الرحمن الرحيم<br />
الدالة بسيطة ولكنها مفيدة جدا لانشاء كلمات المرور العشوائية او استخدمها في اختصار الروابط الذي اعمل عليه حاليا<br />
الدالة تأخد براميتر واحد غير الزامي اي اذا كتبت رقم 6 داخل الدالة سيطبع 6 حروف اما اذا كتبت الدالة بدون برامتر ستطبع الرقم الافتراض وهو 2 حروف</p>
<p><span id="more-332"></span></p>
<div class="igBar"><span id="lphp-15"><a href="#" onclick="javascript:showPlainTxt('php-15'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-15">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">function</span> short<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$number</span>=<span style="color:#FF0000;">'2'</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#0000FF;">$str_and_int</span>=<a href="http://www.php.net/array"><span style="color:#000066;">array</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'a'</span>,<span style="color:#FF0000;">'b'</span>,<span style="color:#FF0000;">'c'</span>,<span style="color:#FF0000;">'d'</span>,<span style="color:#FF0000;">'e'</span>,<span style="color:#FF0000;">'f'</span>,<span style="color:#FF0000;">'g'</span>,<span style="color:#FF0000;">'h'</span>,<span style="color:#FF0000;">'i'</span>,<span style="color:#FF0000;">'j'</span>,<span style="color:#FF0000;">'k'</span>,<span style="color:#FF0000;">'l'</span>,<span style="color:#FF0000;">'m'</span>,<span style="color:#FF0000;">'n'</span>,<span style="color:#FF0000;">'o'</span>,<span style="color:#FF0000;">'p'</span>,<span style="color:#FF0000;">'q'</span>,<span style="color:#FF0000;">'r'</span>,<span style="color:#FF0000;">'s'</span>,<span style="color:#FF0000;">'t'</span>,<span style="color:#FF0000;">'u'</span>,<span style="color:#FF0000;">'v'</span>,<span style="color:#FF0000;">'w'</span>,<span style="color:#FF0000;">'x'</span>,<span style="color:#FF0000;">'y'</span>,<span style="color:#FF0000;">'z'</span>,</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#FF0000;">'A'</span>,<span style="color:#FF0000;">'B'</span>,<span style="color:#FF0000;">'C'</span>,<span style="color:#FF0000;">'D'</span>,<span style="color:#FF0000;">'E'</span>,<span style="color:#FF0000;">'F'</span>,<span style="color:#FF0000;">'G'</span>,<span style="color:#FF0000;">'H'</span>,<span style="color:#FF0000;">'I'</span>,<span style="color:#FF0000;">'J'</span>,<span style="color:#FF0000;">'K'</span>,<span style="color:#FF0000;">'L'</span>,<span style="color:#FF0000;">'M'</span>,<span style="color:#FF0000;">'N'</span>,<span style="color:#FF0000;">'O'</span>,<span style="color:#FF0000;">'P'</span>,<span style="color:#FF0000;">'Q'</span>,<span style="color:#FF0000;">'R'</span>,<span style="color:#FF0000;">'S'</span>,<span style="color:#FF0000;">'T'</span>,<span style="color:#FF0000;">'U'</span>,<span style="color:#FF0000;">'V'</span>,<span style="color:#FF0000;">'W'</span>,<span style="color:#FF0000;">'X'</span>,<span style="color:#FF0000;">'Y'</span>,<span style="color:#FF0000;">'Z'</span>,</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#FF0000;">'0'</span>,<span style="color:#FF0000;">'1'</span>,<span style="color:#FF0000;">'2'</span>,<span style="color:#FF0000;">'3'</span>,<span style="color:#FF0000;">'4'</span>,<span style="color:#FF0000;">'5'</span>,<span style="color:#FF0000;">'6'</span>,<span style="color:#FF0000;">'7'</span>,<span style="color:#FF0000;">'8'</span>,<span style="color:#FF0000;">'9'</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#0000FF;">$d</span>=<span style="color:#CC66CC;color:#800000;">0</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#0000FF;">$cnt</span>=<a href="http://www.php.net/count"><span style="color:#000066;">count</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$str_and_int</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#616100;">while</span><span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#0000FF;">$d</span> &lt;<span style="color:#0000FF;">$number</span> <span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$d</span>++;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$short</span>.=<span style="color:#0000FF;">$str_and_int</span><span style="color:#006600; font-weight:bold;">&#91;</span><a href="http://www.php.net/rand"><span style="color:#000066;">rand</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC66CC;color:#800000;">0</span>,<span style="color:#0000FF;">$cnt</span><span style="color:#006600; font-weight:bold;">&#41;</span>-<span style="color:#CC66CC;color:#800000;">1</span><span style="color:#006600; font-weight:bold;">&#93;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span> </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#616100;">return</span> <span style="color:#0000FF;">$short</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>طريقة عملها </p>
<div class="igBar"><span id="lphp-16"><a href="#" onclick="javascript:showPlainTxt('php-16'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-16">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#0000FF;">$short</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC66CC;color:#800000;">6</span><span style="color:#006600; font-weight:bold;">&#41;</span>; <span style="color:#FF9933; font-style:italic;">// CgF5S6</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#0000FF;">$short</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC66CC;color:#800000;">6</span><span style="color:#006600; font-weight:bold;">&#41;</span>; <span style="color:#FF9933; font-style:italic;">// mlkjBK</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#0000FF;">$short</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC66CC;color:#800000;">6</span><span style="color:#006600; font-weight:bold;">&#41;</span>; <span style="color:#FF9933; font-style:italic;">// 54LKYp</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#0000FF;">$short</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>; <span style="color:#FF9933; font-style:italic;">// pK</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#0000FF;">$short</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>; <span style="color:#FF9933; font-style:italic;">// Z5</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#0000FF;">$short</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC66CC;color:#800000;">8</span><span style="color:#006600; font-weight:bold;">&#41;</span>; <span style="color:#FF9933; font-style:italic;">// DlglkdZ5 </span></div>
</li>
</ol>
</div>
</div>
</div>
<p>
هذ فان اخطأت فمن نفسي والشيطان وان اصبت فمن الله  عز وجل</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bp.ma/2009/06/04/%d8%af%d8%a7%d9%84%d8%a9-%d8%a7%d9%86%d8%b4%d8%a7%d8%a1-%d9%86%d8%b5-%d8%b9%d8%b4%d9%88%d8%a7%d8%a6%d9%8a/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>تعرف على التعليقات او الرسائل المزعجة من خلا هذه الدالة البسيطة</title>
		<link>http://www.bp.ma/2009/05/02/%d8%aa%d8%b9%d8%b1%d9%81-%d8%b9%d9%84%d9%89-%d8%a7%d9%84%d8%aa%d8%b9%d9%84%d9%8a%d9%82%d8%a7%d8%aa-%d8%a7%d9%88-%d8%a7%d9%84%d8%b1%d8%b3%d8%a7%d8%a6%d9%84-%d8%a7%d9%84%d9%85%d8%b2%d8%b9%d8%ac%d8%a9/</link>
		<comments>http://www.bp.ma/2009/05/02/%d8%aa%d8%b9%d8%b1%d9%81-%d8%b9%d9%84%d9%89-%d8%a7%d9%84%d8%aa%d8%b9%d9%84%d9%8a%d9%82%d8%a7%d8%aa-%d8%a7%d9%88-%d8%a7%d9%84%d8%b1%d8%b3%d8%a7%d8%a6%d9%84-%d8%a7%d9%84%d9%85%d8%b2%d8%b9%d8%ac%d8%a9/#comments</comments>
		<pubDate>Sat, 02 May 2009 20:38:20 +0000</pubDate>
		<dc:creator>عبد الواحد البشيري</dc:creator>
				<category><![CDATA[CSS XHTML HTML]]></category>
		<category><![CDATA[classes  الكائنات]]></category>
		<category><![CDATA[php  البي اتش بي]]></category>
		<category><![CDATA[دروس برمجية]]></category>
		<category><![CDATA[expression]]></category>
		<category><![CDATA[function]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[regular]]></category>
		<category><![CDATA[spam]]></category>
		<category><![CDATA[spams]]></category>
		<category><![CDATA[التعابير]]></category>
		<category><![CDATA[القياسية]]></category>
		<category><![CDATA[تعلم]]></category>
		<category><![CDATA[دالة]]></category>
		<category><![CDATA[درس]]></category>
		<category><![CDATA[دروس]]></category>
		<category><![CDATA[رصد]]></category>
		<category><![CDATA[عناوين]]></category>
		<category><![CDATA[عنوان]]></category>
		<category><![CDATA[مزعج]]></category>

		<guid isPermaLink="false">http://www.bp.ma/?p=271</guid>
		<description><![CDATA[بسم الله الرحمن الرحيم لابد وانك برمجت موقع للمقالات او الأخبار او الاتصال بنا وواجهتك مشكلة التعليقات المزعجة التي تحتوي على روابط كثيرة ... اليوم سنكتب سطر بمجي يحل المشكلة بسهولة سنستخدم التعابير القياسية لرصد العناوين الموجودة داخل النص المرسل جرب هذا الكود PLAIN TEXT PHP: // تجربة كتبة عناوين باشكال مختلفة $text=" hello my [...]]]></description>
			<content:encoded><![CDATA[<p>بسم الله الرحمن الرحيم<br />
لابد وانك برمجت موقع للمقالات او الأخبار او الاتصال بنا وواجهتك مشكلة التعليقات المزعجة التي تحتوي على روابط كثيرة ...<br />
اليوم سنكتب سطر بمجي يحل المشكلة بسهولة</p>
<p>سنستخدم التعابير القياسية لرصد العناوين الموجودة داخل النص المرسل</p>
<p><span id="more-271"></span></p>
<p>جرب هذا الكود</p>
<div class="igBar"><span id="lphp-19"><a href="#" onclick="javascript:showPlainTxt('php-19'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-19">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// تجربة كتبة عناوين باشكال مختلفة</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$text</span>=<span style="color:#FF0000;">"</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF0000;">hello my friends i'm here now&nbsp; in my site web</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF0000;">his&nbsp; &nbsp;name www.bp.ma</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF0000;">or http://www.bp.ma</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF0000;">or http://bp.ma</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF0000;">or bp.ma</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF0000;">and other site www.rifpress.net</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF0000;">and market.ma</span></div>
</li>
<li style="font-weight: bold;color:#26536A;"></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF0000;">"</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">/*</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">* شرح التعبير القياسي الذي يتأكد من الرابط</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">([www.|http://|http://www.]*) يتأكد من بداية عنوان الموقع</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">[a-zA-Z0-9-.]+&nbsp; حروف&nbsp; &nbsp; &nbsp; &nbsp;كبيرة وصغيرة انجليزية وارقام علامة ناقص ونقطة</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">\. النقطة التي تكتب بين اسم الدومين والامتداد مثل .com .net .org</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">[a-zA-Z.]{2,5} عدد حروف الامتداد يجب ان يكون بين اثنين الى خمس حروف مثال .ma .net .com .co.uk</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">*/</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/preg_match_all"><span style="color:#000066;">preg_match_all</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">"#([www.|http://|http://www.]*)[a-zA-Z0-9-.]+<span style="color:#000099; font-weight:bold;">\.</span>[a-zA-Z.]{2,5}#"</span>,<span style="color:#0000FF;">$text</span>,<span style="color:#0000FF;">$cnt</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a><span style="color:#FF0000;">"</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF0000;">&lt;pre&gt;"</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/print_r"><span style="color:#000066;">print_r</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$cnt</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">/*</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"></li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">(</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"></li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; [0] =&amp;gt; www.bp.ma</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"></li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; [1] =&amp;gt; http://www.bp.ma</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"></li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; [2] =&amp;gt; http://bp.ma</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"></li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; [3] =&amp;gt; bp.ma</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"></li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; [4] =&amp;gt; www.rifpress.net</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"></li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; [5] =&amp;gt; market.ma</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"></li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">&nbsp; &nbsp; &nbsp; &nbsp; )</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"></li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">*/</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">?&amp;gt; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>طيب الأن سننشئ دالة تقوم بحساب عدد العناوين لكي نعرف هل الرسالة مزعجة ام لا</p>
<div class="igBar"><span id="lphp-20"><a href="#" onclick="javascript:showPlainTxt('php-20'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-20">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">function</span> is_spam<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$text</span>,<span style="color:#0000FF;">$max</span>=<span style="color:#CC66CC;color:#800000;">2</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#008000;">/*</span></div>
</li>
<li style="font-weight: bold;color:#26536A;"></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">&nbsp; &nbsp; &nbsp;$text = النص</span></div>
</li>
<li style="font-weight: bold;color:#26536A;"></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">&nbsp; &nbsp; &nbsp;$max&nbsp; = العدد المسموح به لكي لا يكون النص مزعج</span></div>
</li>
<li style="font-weight: bold;color:#26536A;"></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; الرقم مبدئيا هو 2 ولكن يمك تعديله عند تشغيل الدالة</span></div>
</li>
<li style="font-weight: bold;color:#26536A;"></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">&nbsp; &nbsp; &nbsp;*/</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <a href="http://www.php.net/preg_match_all"><span style="color:#000066;">preg_match_all</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">"#([www.|http://|http://www.]*)[a-zA-Z0-9-.]+<span style="color:#000099; font-weight:bold;">\.</span>[a-zA-Z.]{2,5}#"</span>,<span style="color:#0000FF;">$text</span>,<span style="color:#0000FF;">$cnt</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp;<span style="color:#616100;">if</span><span style="color:#006600; font-weight:bold;">&#40;</span> <a href="http://www.php.net/count"><span style="color:#000066;">count</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$cnt</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#CC66CC;color:#800000;">0</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span>&amp;gt; <span style="color:#0000FF;">$max</span> <span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color:#616100;">return</span> <span style="color:#000000; font-weight:bold;">true</span>; <span style="color:#FF9933; font-style:italic;">// عدد العناوين التي تم رصدها تجاوزت العدد المسموح</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp;<span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#616100;">else</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color:#616100;">return</span> <span style="color:#000000; font-weight:bold;">false</span>; <span style="color:#FF9933; font-style:italic;">// لم يتجاوز العدد المسموح</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp;<span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;<span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// طريقة الاستخدام</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$message</span>=<span style="color:#FF0000;">"</span></div>
</li>
<li style="font-weight: bold;color:#26536A;"></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF0000;">hello my friends i'm here now&nbsp; in my site web</span></div>
</li>
<li style="font-weight: bold;color:#26536A;"></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF0000;">his&nbsp; &nbsp;name www.bp.ma</span></div>
</li>
<li style="font-weight: bold;color:#26536A;"></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF0000;">or http://www.bp.ma</span></div>
</li>
<li style="font-weight: bold;color:#26536A;"></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF0000;">or http://bp.ma</span></div>
</li>
<li style="font-weight: bold;color:#26536A;"></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF0000;">or bp.ma</span></div>
</li>
<li style="font-weight: bold;color:#26536A;"></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF0000;">and other site www.rifpress.net</span></div>
</li>
<li style="font-weight: bold;color:#26536A;"></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF0000;">and market.ma</span></div>
</li>
<li style="font-weight: bold;color:#26536A;"></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF0000;">&nbsp; &nbsp; "</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#616100;">if</span><span style="color:#006600; font-weight:bold;">&#40;</span> is_spam<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$message</span>,<span style="color:#CC66CC;color:#800000;">3</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">"spam"</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#616100;">else</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">"not spam"</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">?&amp;gt; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>اذا ما هو تعليقك على هذا الدرس ؟ هل هناك مشاكل لم الاحظها ؟</p>
<p>والسلام عليكم</p>
<p>هذا فان اخطأت فمن نفسي والشيطان وان اصبت فمن الله عز وجل</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.bp.ma/2009/05/02/%d8%aa%d8%b9%d8%b1%d9%81-%d8%b9%d9%84%d9%89-%d8%a7%d9%84%d8%aa%d8%b9%d9%84%d9%8a%d9%82%d8%a7%d8%aa-%d8%a7%d9%88-%d8%a7%d9%84%d8%b1%d8%b3%d8%a7%d8%a6%d9%84-%d8%a7%d9%84%d9%85%d8%b2%d8%b9%d8%ac%d8%a9/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>دالة اضافة الفاصلة الى الأرقام</title>
		<link>http://www.bp.ma/2009/04/10/%d8%af%d8%a7%d9%84%d8%a9-%d8%a7%d8%b6%d8%a7%d9%81%d8%a9-%d8%a7%d9%84%d9%81%d8%a7%d8%b5%d9%84%d8%a9-%d8%a7%d9%84%d9%89-%d8%a7%d9%84%d8%a3%d8%b1%d9%82%d8%a7%d9%85/</link>
		<comments>http://www.bp.ma/2009/04/10/%d8%af%d8%a7%d9%84%d8%a9-%d8%a7%d8%b6%d8%a7%d9%81%d8%a9-%d8%a7%d9%84%d9%81%d8%a7%d8%b5%d9%84%d8%a9-%d8%a7%d9%84%d9%89-%d8%a7%d9%84%d8%a3%d8%b1%d9%82%d8%a7%d9%85/#comments</comments>
		<pubDate>Fri, 10 Apr 2009 12:33:51 +0000</pubDate>
		<dc:creator>عبد الواحد البشيري</dc:creator>
				<category><![CDATA[php  البي اتش بي]]></category>
		<category><![CDATA[function]]></category>
		<category><![CDATA[ارقام]]></category>
		<category><![CDATA[برمجة]]></category>
		<category><![CDATA[دالة]]></category>
		<category><![CDATA[رقم]]></category>
		<category><![CDATA[فاصلة]]></category>
		<category><![CDATA[نص برمجي]]></category>

		<guid isPermaLink="false">http://www.bp.ma/?p=208</guid>
		<description><![CDATA[بعد ان استفسر عضو في سوالف عن كيفيةاضافة الفاصلة الى الأرقام بعد ثالاثة ارقام رديت عليه بنص برمجي ولكنني احببت ان اجعله في دالة ما عليك سوى اضافة الرقم اليها وترجع لك الرقم مع الفاصلة PLAIN TEXT PHP: function with_comma&#40;$int&#41;&#123; &#160; &#160; if&#40; is_numeric&#40;$int&#41; &#41;&#123; &#160; &#160; &#160; &#160; $int=&#40;strrev&#40;$int&#41;&#41;; &#160; &#160; &#160; &#160; preg_match_all&#40;"#[0-9]{1,3}#",$int,$m&#41;; [...]]]></description>
			<content:encoded><![CDATA[<p>بعد ان استفسر عضو في سوالف عن كيفيةاضافة الفاصلة الى الأرقام بعد ثالاثة ارقام رديت عليه بنص برمجي</p>
<p>ولكنني احببت ان اجعله في دالة</p>
<p>ما عليك سوى اضافة الرقم اليها وترجع لك الرقم مع الفاصلة</p>
<div class="igBar"><span id="lphp-22"><a href="#" onclick="javascript:showPlainTxt('php-22'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-22">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">function</span> with_comma<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$int</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#616100;">if</span><span style="color:#006600; font-weight:bold;">&#40;</span> <a href="http://www.php.net/is_numeric"><span style="color:#000066;">is_numeric</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$int</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$int</span>=<span style="color:#006600; font-weight:bold;">&#40;</span><a href="http://www.php.net/strrev"><span style="color:#000066;">strrev</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$int</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/preg_match_all"><span style="color:#000066;">preg_match_all</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">"#[0-9]{1,3}#"</span>,<span style="color:#0000FF;">$int</span>,<span style="color:#0000FF;">$m</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#616100;">return</span> <a href="http://www.php.net/strrev"><span style="color:#000066;">strrev</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><a href="http://www.php.net/implode"><span style="color:#000066;">implode</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">','</span>,<span style="color:#0000FF;">$m</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#CC66CC;color:#800000;">0</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#616100;">else</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#616100;">return</span> <span style="color:#CC66CC;color:#800000;">0</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">//طريقة الاستخدام</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> with_comma<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC66CC;color:#800000;">12345678</span><span style="color:#006600; font-weight:bold;">&#41;</span>; <span style="color:#FF9933; font-style:italic;">//12,345,678 </span></div>
</li>
</ol>
</div>
</div>
</div>
<p>
مع ملاحظة استخدام الدالة بشكل ضيق<br />
يعني نت الأحسن ان لا تستخدمها في عرض البيانات استخدمها عند ادخال البيانات الى القاعدة<br />
السبب هو ان دالة<br />
preg_match_all<br />
 تأخد حيز من الذاكرة اكثر من الدوال الأخرى<br />
جمعة مباركة <img src='http://www.bp.ma/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.bp.ma/2009/04/10/%d8%af%d8%a7%d9%84%d8%a9-%d8%a7%d8%b6%d8%a7%d9%81%d8%a9-%d8%a7%d9%84%d9%81%d8%a7%d8%b5%d9%84%d8%a9-%d8%a7%d9%84%d9%89-%d8%a7%d9%84%d8%a3%d8%b1%d9%82%d8%a7%d9%85/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[دالة] is_numeric للتأكد ان القيمة رقمية</title>
		<link>http://www.bp.ma/2008/05/15/%d8%af%d8%a7%d9%84%d8%a9-is_numeric-%d9%84%d9%84%d8%aa%d8%a3%d9%83%d8%af-%d8%a7%d9%86-%d8%a7%d9%84%d9%82%d9%8a%d9%85%d8%a9-%d8%b1%d9%82%d9%85%d9%8a%d8%a9/</link>
		<comments>http://www.bp.ma/2008/05/15/%d8%af%d8%a7%d9%84%d8%a9-is_numeric-%d9%84%d9%84%d8%aa%d8%a3%d9%83%d8%af-%d8%a7%d9%86-%d8%a7%d9%84%d9%82%d9%8a%d9%85%d8%a9-%d8%b1%d9%82%d9%85%d9%8a%d8%a9/#comments</comments>
		<pubDate>Thu, 15 May 2008 11:35:16 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[دروس برمجية]]></category>
		<category><![CDATA[function]]></category>
		<category><![CDATA[numeric]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://bp.ma/?p=37</guid>
		<description><![CDATA[يسم الله الرحمان الرحيم باستخدام هذه الدالة تستطيع معرفة القيمة هل هي رقمية ام نصية مثال : PLAIN TEXT PHP: $text="021545454"; if&#40; is_numeric&#40; $text &#41; &#41; &#123; echo "القيمة رقمية"; &#125; else &#123; echo " خطأ "; &#125; // النتيجة  &#34;القيمة رقمية&#34; اضافة ممكن تنفعك ماذا لو ان لديك تعدد الصفحات ( اذا كنت ﻻ [...]]]></description>
			<content:encoded><![CDATA[<p>يسم الله الرحمان الرحيم</p>
<p>باستخدام هذه الدالة تستطيع معرفة القيمة هل هي رقمية ام نصية</p>
<p>مثال :</p>
<div class="igBar"><span id="lphp-26"><a href="#" onclick="javascript:showPlainTxt('php-26'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-26">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$text</span>=<span style="color:#FF0000;">"021545454"</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#616100;">if</span><span style="color:#006600; font-weight:bold;">&#40;</span> <a href="http://www.php.net/is_numeric"><span style="color:#000066;">is_numeric</span></a><span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#0000FF;">$text</span> <span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">"القيمة رقمية"</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#616100;">else</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">" خطأ "</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// النتيجة  &quot;القيمة رقمية&quot; </span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>اضافة ممكن تنفعك</p>
<p>ماذا لو ان لديك تعدد الصفحات ( اذا كنت ﻻ تعرف تعدد الصفحات سيأتي يوم تصل اليه ﻻ تخف)  ويكون الرابط هكذا</p>
<p>artcile.php?id=214&amp;page=3 ممتاز سيعمل جيدا ويكون المتغير هكذا</p>
<div class="igBar"><span id="lphp-27"><a href="#" onclick="javascript:showPlainTxt('php-27'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-27">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$page</span>=<span style="color:#0000FF;">$_GET</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'page'</span><span style="color:#006600; font-weight:bold;">&#93;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>وماذا سيحصل لو ان الرابط هكذا   artcile.php?id=214</p>
<p>ستحصل مشاكل وهي عدم اعطاء قيمة للمتغير page</p>
<p>وتأتي هذه التركيبة لتحل المشكلة</p>
<div class="igBar"><span id="lphp-28"><a href="#" onclick="javascript:showPlainTxt('php-28'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-28">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$page</span>=<span style="color:#006600; font-weight:bold;">&#40;</span>!<a href="http://www.php.net/is_numeric"><span style="color:#000066;">is_numeric</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$page</span><span style="color:#006600; font-weight:bold;">&#41;</span> ? <span style="color:#CC66CC;color:#800000;">1</span> : <span style="color:#0000FF;">$page</span><span style="color:#006600; font-weight:bold;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>لنشرح هذا السطر البرمجي البسيط ..</p>
<p>اذا كان المتغير فارغ او غير رقمي اعطيه القيمة "1" او اتركه يحمل القيمة اﻷصلية</p>
<p>فوائد :</p>
<p>التأكد من عدم وضع اوامر ممكن تخترق القاعدة<br />
اضافة قيمة انت تحددها</p>
<p>يمكن تغيير الرقم "1" الى اي قيمة تصلح لبرنامجك.</p>
<p>والسﻻم عليكم</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bp.ma/2008/05/15/%d8%af%d8%a7%d9%84%d8%a9-is_numeric-%d9%84%d9%84%d8%aa%d8%a3%d9%83%d8%af-%d8%a7%d9%86-%d8%a7%d9%84%d9%82%d9%8a%d9%85%d8%a9-%d8%b1%d9%82%d9%85%d9%8a%d8%a9/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>جدول متدرج اﻷلوان</title>
		<link>http://www.bp.ma/2008/05/02/%d8%ac%d8%af%d9%88%d9%84-%d9%85%d8%aa%d8%af%d8%b1%d8%ac-%d8%a7%ef%bb%b7%d9%84%d9%88%d8%a7%d9%86/</link>
		<comments>http://www.bp.ma/2008/05/02/%d8%ac%d8%af%d9%88%d9%84-%d9%85%d8%aa%d8%af%d8%b1%d8%ac-%d8%a7%ef%bb%b7%d9%84%d9%88%d8%a7%d9%86/#comments</comments>
		<pubDate>Fri, 02 May 2008 22:34:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CSS XHTML HTML]]></category>
		<category><![CDATA[php  البي اتش بي]]></category>
		<category><![CDATA[function]]></category>
		<category><![CDATA[href]]></category>
		<category><![CDATA[multicolor]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[table]]></category>

		<guid isPermaLink="false">http://bp.ma/?p=36</guid>
		<description><![CDATA[بسم الله الرحمن الرحيم ﻻشك انك رأيت في بعض المواقع جدول وصفوفه مرة ابيض ومرة رصاصي او بلون اخر سأشرح الطريقة بكل سهولة كتبت من قبل عن جدول انيق حتما ستستفيد منه اﻷن سنبرمج دالة بسيطة ونعطيها برامتر واحد PLAIN TEXT PHP: function color&#40;$var&#41; &#123; &#160; if&#40;$var % 2 == 0&#41; // اذا كان ناتج [...]]]></description>
			<content:encoded><![CDATA[<p>بسم الله الرحمن الرحيم</p>
<p>ﻻشك انك رأيت في بعض المواقع جدول وصفوفه مرة ابيض ومرة رصاصي او بلون اخر</p>
<p><img src="http://bp.ma/doros/table_color/table_color.gif" alt="" /></p>
<p>سأشرح الطريقة بكل سهولة</p>
<p>كتبت من قبل عن <a href="http://bp.ma/2008/01/09/%d8%ac%d8%af%d9%88%d9%84-%d8%a3%d9%86%d9%8a%d9%82" target="_blank">جدول انيق </a>حتما ستستفيد منه</p>
<p>اﻷن سنبرمج دالة بسيطة ونعطيها برامتر واحد</p>
<div class="igBar"><span id="lphp-32"><a href="#" onclick="javascript:showPlainTxt('php-32'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-32">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">function</span> color<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$var</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#616100;">if</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$var</span> % <span style="color:#CC66CC;color:#800000;">2</span> == <span style="color:#CC66CC;color:#800000;">0</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#FF9933; font-style:italic;">// اذا كان ناتج قسمة العدد على اثنين يساوي صفر اعطيه اللون اﻷبيص</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#616100;">return</span> <span style="color:#FF0000;">"#ffffff"</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#616100;">else</span> <span style="color:#FF9933; font-style:italic;">// اعيه اللون اﻷخر</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#616100;">return</span> <span style="color:#FF0000;">"#cc0000"</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p>
اﻷن نكتب حلقة تكرار لتجربة الدالة التي برمجنها</p>
<div class="igBar"><span id="lphp-33"><a href="#" onclick="javascript:showPlainTxt('php-33'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-33">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$table</span>= <span style="color:#FF0000;">"</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF0000;">&lt;table border="</span>0<span style="color:#FF0000;">" cellspacing="</span>1<span style="color:#FF0000;">" cellpadding="</span>1<span style="color:#FF0000;">" width="</span>300<span style="color:#FF0000;">"&gt;n"</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$table</span>.=<span style="color:#FF0000;">"</span></div>
</li>
<li style="font-weight: bold;color:#26536A;"></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF0000;">&lt;tbody&gt;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF0000;">&lt;tr bgcolor="</span><span style="color:#008000; font-style:italic;">#cc99ff&quot;&gt;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;td&gt;Title&lt;/td&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">;&lt;/tr&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">n<span style="color:#FF0000;">";</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF0000;">for($i=0;$i&lt;10;$i++)</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF0000;">{</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF0000;">$table.="</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;tr bgcolor=<span style="color:#FF0000;">'&quot;.color($i).&quot;'</span>&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;td&gt;var <span style="color:#FF0000;">".$i."</span>&lt;/td&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">;&lt;/tr&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">n<span style="color:#FF0000;">";</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"></li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF0000;">}</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF0000;">$table.= "</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;/tbody&gt;&lt;/table&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF0000;">";</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"></li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF0000;">// هنا نطبع الجدول</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF0000;">echo $table; </span></div>
</li>
</ol>
</div>
</div>
</div>
<p>
السطر اﻷول فتحنا به الجدول<br />
السطر الثاني صف ﻻ يتكرر وكتبت في title<br />
الثالث حلقة تكرار وهي معروفة<br />
الخامس يتم تخزين الصفوف المكررة مع الوانها ...<br />
السابع قفل الجدول<br />
والسطر اﻷخير طباعة الجدول</p>
<p>يمكن اختصار الدالة الى</p>
<div class="igBar"><span id="lphp-34"><a href="#" onclick="javascript:showPlainTxt('php-34'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-34">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">function</span> color<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$var</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#616100;">return</span> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$var</span>%<span style="color:#CC66CC;color:#800000;">2</span><span style="color:#006600; font-weight:bold;">&#41;</span> ?&nbsp; <span style="color:#FF0000;">"#cccccc"</span> : <span style="color:#FF0000;">"#ffffff"</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>اتمنى ان يكون الدرس خفيف ومفهوم</p>
<p>السلام عليكم</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bp.ma/2008/05/02/%d8%ac%d8%af%d9%88%d9%84-%d9%85%d8%aa%d8%af%d8%b1%d8%ac-%d8%a7%ef%bb%b7%d9%84%d9%88%d8%a7%d9%86/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
