<?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>Webmaster Chronic Blog &#187; PHP</title>
	<atom:link href="http://www.webmasterchronic.com/topics/code/snippets/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.webmasterchronic.com</link>
	<description>Giving You the Good Stuff Since 2k9</description>
	<lastBuildDate>Thu, 29 Jul 2010 12:03:01 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Word Count, Syllable Count, Sentence Count, Flesch Reading Ease Score, etc.</title>
		<link>http://www.webmasterchronic.com/code/snippets/php/word-count-syllable-count-sentence-count-flesch-reading-ease-score-etc/</link>
		<comments>http://www.webmasterchronic.com/code/snippets/php/word-count-syllable-count-sentence-count-flesch-reading-ease-score-etc/#comments</comments>
		<pubDate>Thu, 10 Dec 2009 08:37:45 +0000</pubDate>
		<dc:creator>kpaul</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[maths and english]]></category>
		<category><![CDATA[php code]]></category>
		<category><![CDATA[php reading level]]></category>
		<category><![CDATA[PHP snippets]]></category>
		<category><![CDATA[php wordcount]]></category>

		<guid isPermaLink="false">http://www.webmasterchronic.com/?p=520</guid>
		<description><![CDATA[I forget where exactly I lifted these from, but they&#8217;ve been very useful for some coding projects I&#8217;ve been working on silently in the background. I thought I would share them here. Enjoy and use responsibly. Simple Measure of Gobbledygook is actually pretty cool. Flesch Reading Ease Score you&#8217;ve probably heard of before. It&#8217;s another [...]


Related posts:<ol><li><a href='http://www.webmasterchronic.com/media/video/dizzee-rascal-where-da-gs/' rel='bookmark' title='Permanent Link: Dizzee Rascal &#8211; Where Da G&#8217;s'>Dizzee Rascal &#8211; Where Da G&#8217;s</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>I forget where exactly I lifted these from, but they&#8217;ve been very useful for some coding projects I&#8217;ve been working on silently in the background.</p>
<div id="attachment_523" class="wp-caption alignright" style="width: 106px"><img class="size-medium wp-image-523" title="maths-and-english" src="http://www.webmasterchronic.com/wp-content/uploads/2009/12/maths-and-english-225x300.jpg" alt="Maths and English" width="96" height="84" /><p class="wp-caption-text">Maths and English</p></div>
<p>I thought I would share them here. Enjoy and use responsibly.</p>
<ul>
<li><a href="http://www.harrymclaughlin.com/SMOG.htm">Simple Measure of Gobbledygook</a> is actually pretty cool.</li>
<li><a href="http://www.readabilityformulas.com/flesch-reading-ease-readability-formula.php">Flesch Reading Ease Score</a> you&#8217;ve probably heard of before. It&#8217;s another way to &#8220;grade&#8221; text/content/words.</li>
</ul>
<p>Maths and english, boys, maths and english&#8230;</p>
<p><!--break--></p>
<pre>
<pre style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width: 500px; height: 400px; text-align: left;" dir="ltr">// Number of words: number of space series or linebreaks + 1
$wc = preg_match_all( '/[ \r]/', preg_replace( '/ +/', ' ', $mynewtext), $tmp );
// Number of syllables: vowels not followed by another vowel. Quite accurate approximation.
$syc = preg_match_all( '/[aeiouy][^aeiouy]/', $mynewtext, $tmp );
// Number of polysyllabic words (&gt;=3 syllables): Vowel, non-spaces, vowel, non-spaces, vowel (or more non-spaces-vowel)
$psyc = preg_match_all( '/[aeiouy]([^ ]*[aeiouy]){2,}/', $mynewtext, $tmp );
// Number of sentences: Number of periods, exclamation marks, question marks and linebreaks
$sec = preg_match_all( '/[.!?\r]/', $mynewtext, $tmp );
// Flesch Reading Ease Score
$fres = 206.835 - 1.015 * ( $wc / $sec ) - 84.6 * ( $syc / $wc );
// Simple Measure of Gobbledygook
$smog = 1.043 * sqrt( $psyc * ( 30 / $sec ) ) + 3.1291;</pre>
</pre>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.webmasterchronic.com%2Fcode%2Fsnippets%2Fphp%2Fword-count-syllable-count-sentence-count-flesch-reading-ease-score-etc%2F&amp;linkname=Word%20Count%2C%20Syllable%20Count%2C%20Sentence%20Count%2C%20Flesch%20Reading%20Ease%20Score%2C%20etc."><img src="http://www.webmasterchronic.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>

<p>Related posts:<ol><li><a href='http://www.webmasterchronic.com/media/video/dizzee-rascal-where-da-gs/' rel='bookmark' title='Permanent Link: Dizzee Rascal &#8211; Where Da G&#8217;s'>Dizzee Rascal &#8211; Where Da G&#8217;s</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.webmasterchronic.com/code/snippets/php/word-count-syllable-count-sentence-count-flesch-reading-ease-score-etc/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Quick and Dirty CSV to RSS/XML for WordPress Import&#8230;</title>
		<link>http://www.webmasterchronic.com/code/snippets/quick-and-dirty-csv-to-rssxml-for-wordpress-import/</link>
		<comments>http://www.webmasterchronic.com/code/snippets/quick-and-dirty-csv-to-rssxml-for-wordpress-import/#comments</comments>
		<pubDate>Tue, 01 Dec 2009 10:21:14 +0000</pubDate>
		<dc:creator>kpaul</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Snippets]]></category>
		<category><![CDATA[CSS to RSS]]></category>
		<category><![CDATA[CSV to RSS]]></category>
		<category><![CDATA[CSV to WP]]></category>
		<category><![CDATA[CSV2RSS]]></category>
		<category><![CDATA[CSV2WP]]></category>
		<category><![CDATA[PHP scripts]]></category>
		<category><![CDATA[PHP snippets]]></category>
		<category><![CDATA[WordPress Import]]></category>

		<guid isPermaLink="false">http://www.webmasterchronic.com/?p=331</guid>
		<description><![CDATA[After running, you can view the source and save the output to an XML file that you can import into WP. Nothing fancy, but thought it might help one or two ppl&#8230; It is set-up to date the posts every 12 hours, although this is easily changed&#8230; &#60;?php function get_csv($filename, $delim=',') { $row = 0; [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p>After running, you can view the source and save the output to an XML file that you can import into WP. Nothing fancy, but thought it might help one or two ppl&#8230; It is set-up to date the posts every 12 hours, although this is easily changed&#8230;</p>
<p><span id="more-331"></span></p>
<pre>
<pre style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width: 500px; height: 400px; text-align: left;" dir="ltr">&lt;?php
function get_csv($filename, $delim=',')
{
   $row = 0;
   $dump = array();

   $f = fopen ($filename,"r");
   $size = filesize($filename)+1;
   while ($data = fgetcsv($f, $size, $delim)) {
       $dump[$row] = $data;
       $row++;
   }
   fclose ($f);

   return $dump;
}

$myfile = "123.csv";
$xxx=0;
$mywritefile = "";

$test = get_csv($myfile);

foreach ($test as $mthis) {
$xxx++;
$hourcount = ($xxx * 12);
$mincount = (12 * $xxx);
$futuredate = mktime(date("h")+$hourcount,date("i")+$mincount,date("s")+$mincount,date("m"),date("d"),date("Y"));

$mypubdate = date("D, d M Y h:i:s A",$futuredate);

$mywritefile .= "&lt;item&gt;\n";
$mywritefile .= "&lt;title&gt;".$mthis[0]."&lt;/title&gt;\n";
$mywritefile .= "&lt;category&gt;Your Category Tag&lt;/category&gt;\n";
$mywritefile .= "&lt;content:encoded&gt;".$mthis[1]."&lt;br /&gt;".$mthis[2]."&lt;br /&gt;".$mthis[3]."&lt;br /&gt;".$mthis[4]."&lt;/content:encoded&gt;\n";
$mywritefile .= "&lt;pubDate&gt;".$mypubdate."&lt;/pubDate&gt;\n";
$mywritefile .= "&lt;/item&gt;\n\n\n";

}

echo $mywritefile;

?&gt;</pre>
</pre>
<div id="attachment_347" class="wp-caption alignright" style="width: 310px"><img class="size-medium wp-image-347" title="stockxpertcom_id427371_jpg_52b9c0eb0a111428fa0f9a645ff264e4" src="http://www.webmasterchronic.com/wp-content/uploads/2009/12/stockxpertcom_id427371_jpg_52b9c0eb0a111428fa0f9a645ff264e4-300x200.jpg" alt="My Kind of Woman" width="300" height="200" /><p class="wp-caption-text">My Kind of Woman</p></div>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.webmasterchronic.com%2Fcode%2Fsnippets%2Fquick-and-dirty-csv-to-rssxml-for-wordpress-import%2F&amp;linkname=Quick%20and%20Dirty%20CSV%20to%20RSS%2FXML%20for%20WordPress%20Import%26%238230%3B"><img src="http://www.webmasterchronic.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>

<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://www.webmasterchronic.com/code/snippets/quick-and-dirty-csv-to-rssxml-for-wordpress-import/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
