<?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>goran mitev &#187; PHP</title>
	<atom:link href="http://goranmitev.com/category/php/feed" rel="self" type="application/rss+xml" />
	<link>http://goranmitev.com</link>
	<description>Freelance PHP/Ajax Web Developer and Wordpress Expert</description>
	<lastBuildDate>Tue, 10 May 2011 20:09:49 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Formatting date values returned from MYSQL table to more readable format including time</title>
		<link>http://goranmitev.com/formatting-date-values-returned-from-mysql-table-to-more-readable-format-including-time</link>
		<comments>http://goranmitev.com/formatting-date-values-returned-from-mysql-table-to-more-readable-format-including-time#comments</comments>
		<pubDate>Tue, 01 Mar 2011 15:17:30 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[blog]]></category>

		<guid isPermaLink="false">http://goranmitev.com/?p=271</guid>
		<description><![CDATA[echo date("d-m-Y : G-i",strtotime('2011-02-26 09:47:11');]]></description>
			<content:encoded><![CDATA[<pre name="code" class="php">
echo date("d-m-Y : G-i",strtotime('2011-02-26 09:47:11');
</pre>
]]></content:encoded>
			<wfw:commentRss>http://goranmitev.com/formatting-date-values-returned-from-mysql-table-to-more-readable-format-including-time/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>List All Hooked Functions in WordPress</title>
		<link>http://goranmitev.com/list-all-hooked-functions-in-wordpress</link>
		<comments>http://goranmitev.com/list-all-hooked-functions-in-wordpress#comments</comments>
		<pubDate>Fri, 18 Feb 2011 13:49:17 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[blog]]></category>

		<guid isPermaLink="false">http://goranmitev.com/?p=266</guid>
		<description><![CDATA[function list_hooked_functions($tag=false){ global $wp_filter; if ($tag) { $hook[$tag]=$wp_filter[$tag]; if (!is_array($hook[$tag])) { trigger_error("Nothing found for '$tag' hook", E_USER_WARNING); return; } } else { $hook=$wp_filter; ksort($hook); } echo '&#60;pre&#62;'; foreach($hook as $tag =&#62; $priority){ echo "&#60;br /&#62;&#38;gt;&#38;gt;&#38;gt;&#38;gt;&#38;gt;\t&#60;strong&#62;$tag&#60;/strong&#62;&#60;br /&#62;"; ksort($priority); foreach($priority as $priority =&#62; $function){ echo $priority; foreach($function as $name =&#62; $properties) echo "\t$name&#60;br /&#62;"; } } echo [...]]]></description>
			<content:encoded><![CDATA[<pre name="code" class="php">
function list_hooked_functions($tag=false){
 global $wp_filter;
 if ($tag) {
 $hook[$tag]=$wp_filter[$tag];
 if (!is_array($hook[$tag])) {
 trigger_error("Nothing found for '$tag' hook", E_USER_WARNING);
 return;
 }
 }
 else {
 $hook=$wp_filter;
 ksort($hook);
 }
 echo '&lt;pre&gt;';
 foreach($hook as $tag =&gt; $priority){
 echo "&lt;br /&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;\t&lt;strong&gt;$tag&lt;/strong&gt;&lt;br /&gt;";
 ksort($priority);
 foreach($priority as $priority =&gt; $function){
 echo $priority;
 foreach($function as $name =&gt; $properties) echo "\t$name&lt;br /&gt;";
 }
 }
 echo '&lt;/pre&gt;';
 return;
}
[/php]</pre>
<p>source: <a href="http://www.smashingmagazine.com/2009/08/18/10-useful-wordpress-hook-hacks/" target="_blank">http://www.smashingmagazine.com/2009/08/18/10-useful-wordpress-hook-hacks/</a></p>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 351px; width: 1px; height: 1px; overflow: hidden;">
<h3>List All Hooked Functions</h3>
</div>
]]></content:encoded>
			<wfw:commentRss>http://goranmitev.com/list-all-hooked-functions-in-wordpress/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Detect Ajax Request in PHP</title>
		<link>http://goranmitev.com/detect-ajax-request-in-php</link>
		<comments>http://goranmitev.com/detect-ajax-request-in-php#comments</comments>
		<pubDate>Wed, 22 Dec 2010 07:20:34 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[blog]]></category>

		<guid isPermaLink="false">http://goranmitev.com/?p=224</guid>
		<description><![CDATA[if(!empty($_SERVER['HTTP_X_REQUESTED_WITH']) &#38;&#38; strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') { echo "yes"; exit; }]]></description>
			<content:encoded><![CDATA[<pre name="code" class="php">if(!empty($_SERVER['HTTP_X_REQUESTED_WITH']) &amp;&amp; strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') {
 echo "yes";
 exit;
}</pre>
]]></content:encoded>
			<wfw:commentRss>http://goranmitev.com/detect-ajax-request-in-php/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adding a class to first and last menu items to WordPress menu</title>
		<link>http://goranmitev.com/adding-a-class-to-first-and-last-menu-items</link>
		<comments>http://goranmitev.com/adding-a-class-to-first-and-last-menu-items#comments</comments>
		<pubDate>Mon, 13 Dec 2010 11:41:16 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[blog]]></category>

		<guid isPermaLink="false">http://goranmitev.com/?p=218</guid>
		<description><![CDATA[Add this code to your functions.php file: function addFirstLastClass($pageList) { // pattern to focus on just lis $allLisPattern = '/&#60;li(.*)&#60;\/li&#62;/s'; preg_match($allLisPattern,$pageList,$allLis); $liClassPattern =  "/&#60;li[^&#62;]+class=\"([^\"]+)/i"; // first let's break out each li $liArray = explode("\n", $allLis[0]); // count to get last li $liArrayCount = count($liArray); preg_match($liClassPattern, $liArray[0], $firstMatch); $newFirstLi = str_replace($firstMatch[1], $firstMatch[1] . " first-menu-item", $liArray[0]); [...]]]></description>
			<content:encoded><![CDATA[<p>Add this code to your functions.php file:</p>
<pre name="code" class="php">function addFirstLastClass($pageList) {

 // pattern to focus on just lis
 $allLisPattern = '/&lt;li(.*)&lt;\/li&gt;/s';
 preg_match($allLisPattern,$pageList,$allLis);
 $liClassPattern =  "/&lt;li[^&gt;]+class=\"([^\"]+)/i";

 // first let's break out each li
 $liArray = explode("\n", $allLis[0]);

 // count to get last li
 $liArrayCount = count($liArray);

 preg_match($liClassPattern, $liArray[0], $firstMatch);
 $newFirstLi = str_replace($firstMatch[1], $firstMatch[1] . " first-menu-item", $liArray[0]);

 if($liArrayCount &gt; 1){
 $lastLiPosition = $liArrayCount - 1;

 preg_match($liClassPattern, $liArray[$lastLiPosition], $lastMatch);
 $newFirstLi = str_replace($firstMatch[1], $firstMatch[1] . " first-menu-item", $liArray[0]);
 $newLastLi = str_replace($lastMatch[1], $lastMatch[1] . " last-menu-item", $liArray[$lastLiPosition]);
 }

 // replace first and last of the li array with new lis
 // rebuild newPageList
 // set first li
 $newPageList = $newFirstLi . '';
 $i = 1;
 while ($i &lt; $lastLiPosition) {
 $newPageList .= $liArray[$i];
 $i++;
 }
 // set last li
 $newPageList .= $newLastLi;

 // lastly, replace old list with new list
 $pageList = str_replace($allLis[0], $newPageList, $pageList);
 return $pageList;
}
add_filter('wp_nav_menu', 'addFirstLastClass');</pre>
<p>Thanks to <a href="http://www.eliotk.net/">Eliot Kristan</a></p>
]]></content:encoded>
			<wfw:commentRss>http://goranmitev.com/adding-a-class-to-first-and-last-menu-items/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

