<?xml version="1.0" encoding="iso-8859-1"?>
<rss version="2.0">
<channel>
  <title>Linux Format forums</title>
  <link>http://www.linuxformat.com/forums/index.php</link>
  <description>Help, discussion, magazine feedback and more</description>
  <language>english</language>
  <copyright>(c) Copyright Wed Jun 19, 2013 6:16 am by Linux Format forums</copyright>
  <managingEditor>webmaster@linuxformat.com</managingEditor>
  <webMaster>webmaster@linuxformat.com</webMaster>
  <pubDate>Wed Jun 19, 2013 6:16 am</pubDate>
  <lastBuildDate>Wed Jun 19, 2013 6:16 am</lastBuildDate>
  <docs>http://backend.userland.com/rss</docs>
  <generator>phpBB2 RSS Syndication Mod by Lucas</generator>
  <ttl>1</ttl>

  <image>
    <title>Linux Format forums</title>
    <url></url>
    <link>http://www.linuxformat.com/forums/</link>
    <description>Help, discussion, magazine feedback and more</description>
  </image>

                                      <item>
                                        <title>Re: Paul Hudson's Coding Academy Project 1</title>
                                        <link>http://www.linuxformat.com/forums/viewtopic.php?p=93655#93655</link>
                                        <description>&lt;br /&gt;
                                      Author: &lt;a href='http://www.linuxformat.com/forums/profile.php?mode=viewprofile&amp;u=66956'&gt;LinuxNoob&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
                                      Posted: Sat Oct 09, 2010 10:34 am&lt;br /&gt;&lt;br /&gt;
                                      &lt;br /&gt;&lt;br /&gt;
                                      Thanks Ram. That helped a lot. now, to continue with the rest of the book...</description>
                                        <comments>http://www.linuxformat.com/forums/viewtopic.php?p=93655#93655</comments>
                                        <author>LinuxNoob</author>
                                        <pubDate>Sat Oct 09, 2010 10:34 am</pubDate>
                                        <guid isPermaLink="true">http://www.linuxformat.com/forums/viewtopic.php?p=93655#93655</guid>
                                      </item>
                                      <item>
                                        <title>Re: Paul Hudson's Coding Academy Project 1</title>
                                        <link>http://www.linuxformat.com/forums/viewtopic.php?p=93648#93648</link>
                                        <description>&lt;br /&gt;
                                      Author: &lt;a href='http://www.linuxformat.com/forums/profile.php?mode=viewprofile&amp;u=130'&gt;Ram&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
                                      Posted: Fri Oct 08, 2010 7:29 pm&lt;br /&gt;&lt;br /&gt;
                                      &lt;br /&gt;&lt;br /&gt;
                                      Typo in your code, &lt;br /&gt;
&lt;br /&gt;
ob_get_clean&lt;span style=&quot;color: red&quot;&gt;ed&lt;/span&gt;()  should read ob_get_clean()</description>
                                        <comments>http://www.linuxformat.com/forums/viewtopic.php?p=93648#93648</comments>
                                        <author>Ram</author>
                                        <pubDate>Fri Oct 08, 2010 7:29 pm</pubDate>
                                        <guid isPermaLink="true">http://www.linuxformat.com/forums/viewtopic.php?p=93648#93648</guid>
                                      </item>
                                      <item>
                                        <title>Paul Hudson's Coding Academy Project 1</title>
                                        <link>http://www.linuxformat.com/forums/viewtopic.php?p=93646#93646</link>
                                        <description>&lt;br /&gt;
                                      Author: &lt;a href='http://www.linuxformat.com/forums/profile.php?mode=viewprofile&amp;u=66956'&gt;LinuxNoob&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
                                      Posted: Fri Oct 08, 2010 4:47 pm&lt;br /&gt;&lt;br /&gt;
                                      &lt;br /&gt;&lt;br /&gt;
                                      Following all the instructions in the booklet i have gotten so far as to run a function that prints out the root directory and all its subdirectories and then saving it to a output file. Now two things i want to know,&lt;br /&gt;
1. Does this code&lt;br /&gt;
&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
function subdir_scan($dir){&lt;br /&gt;
	$files = scandir($dir);&lt;br /&gt;
	foreach($files as $file){&lt;br /&gt;
		if($file == &amp;quot;.&amp;quot;) continue;&lt;br /&gt;
		if($file == &amp;quot;..&amp;quot;) continue;&lt;br /&gt;
&lt;br /&gt;
		print&amp;quot;$dir/$file\n&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
		if(is_dir(&amp;quot;$dir/$file&amp;quot;)){&lt;br /&gt;
			subdir_scan(&amp;quot;$dir/$file&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
		chdir(&amp;quot;..&amp;quot;);		&lt;br /&gt;
		&lt;br /&gt;
		ob_start();&lt;br /&gt;
		subdir_scan(&amp;quot;.&amp;quot;);		&lt;br /&gt;
                $output = ob_get_cleaned();&lt;br /&gt;
		&lt;br /&gt;
                echo $output&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
save what is being generated automatically or do i have to run the command php project01.php &amp;gt; output in the command line ?&lt;br /&gt;
Because when i run in the command line i get this error...&lt;br /&gt;
PHP Fatal error:  Call to undefined function ob_get_cleaned() in /home/neels/PHP/project01.php on line 23&lt;br /&gt;
but the output.txt does get created in the local directory i created for this purpose.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. When i run the next piece of code to compare the results &lt;br /&gt;
&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
function subdir_scan($dir){&lt;br /&gt;
	$files = scandir($dir);&lt;br /&gt;
	foreach($files as $file){&lt;br /&gt;
		if($file == &amp;quot;.&amp;quot;) continue;&lt;br /&gt;
		if($file == &amp;quot;..&amp;quot;) continue;&lt;br /&gt;
&lt;br /&gt;
		print&amp;quot;$dir/$file\n&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
		if(is_dir(&amp;quot;$dir/$file&amp;quot;)){&lt;br /&gt;
			subdir_scan(&amp;quot;$dir/$file&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
		chdir(&amp;quot;..&amp;quot;);		&lt;br /&gt;
		&lt;br /&gt;
		ob_start();&lt;br /&gt;
		subdir_scan(&amp;quot;.&amp;quot;);		&lt;br /&gt;
                &lt;br /&gt;
		$new_run = ob_get_cleaned();&lt;br /&gt;
		$old_run = file_get_contents(&amp;quot;output&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
		$new_array = explode(&amp;quot;\n&amp;quot;,$new_run);&lt;br /&gt;
		$old_array = explode(&amp;quot;\n&amp;quot;,$old_run);&lt;br /&gt;
&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
It seems it does not do what its suppose to do, or am i doing something wrong ?   [/code]</description>
                                        <comments>http://www.linuxformat.com/forums/viewtopic.php?p=93646#93646</comments>
                                        <author>LinuxNoob</author>
                                        <pubDate>Fri Oct 08, 2010 4:47 pm</pubDate>
                                        <guid isPermaLink="true">http://www.linuxformat.com/forums/viewtopic.php?p=93646#93646</guid>
                                      </item></channel></rss>