<?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>PHP Tips, Help with php cms, php coder from Ukraine</title>
	<atom:link href="http://help-php.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://help-php.com</link>
	<description>PHP snippets and tips</description>
	<lastBuildDate>Thu, 10 Nov 2011 14:35:34 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>PHP 5: Recursively move, copy or delete files and folders</title>
		<link>http://help-php.com/php-5-recursively-move-copy-or-delete-files-and-folders/</link>
		<comments>http://help-php.com/php-5-recursively-move-copy-or-delete-files-and-folders/#comments</comments>
		<pubDate>Thu, 10 Nov 2011 14:35:34 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[copy]]></category>
		<category><![CDATA[del]]></category>
		<category><![CDATA[move]]></category>
		<category><![CDATA[recursive]]></category>

		<guid isPermaLink="false">http://help-php.com/?p=265</guid>
		<description><![CDATA[Recursively move /** * Recursively move files from one directory to another * * @param String $src - Source of files being moved * @param String $dest - Destination of files being moved */ function rmove&#40;$src, $dest&#41;&#123; &#160; // If source is not a directory stop processing if&#40;!is_dir&#40;$src&#41;&#41; return false; &#160; // If the destination ...]]></description>
			<content:encoded><![CDATA[<p><span id="more-265"></span><br />
<strong>Recursively move </strong></p>
<div class="wp_syntax">
<div class="code">
<pre class="php" style="font-family:monospace;"><span style="color: #009933; font-style: italic;">/**
 * Recursively move files from one directory to another
 *
 * @param String $src - Source of files being moved
 * @param String $dest - Destination of files being moved
 */</span>
<span style="color: #000000; font-weight: bold;">function</span> rmove<span style="color: #009900;">&#40;</span><span style="color: #000088;">$src</span><span style="color: #339933;">,</span> <span style="color: #000088;">$dest</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
&nbsp;
    <span style="color: #666666; font-style: italic;">// If source is not a directory stop processing</span>
    <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #990000;">is_dir</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$src</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #666666; font-style: italic;">// If the destination directory does not exist create it</span>
    <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #990000;">is_dir</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$dest</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #990000;">mkdir</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$dest</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #666666; font-style: italic;">// If the destination directory could not be created stop processing</span>
            <span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #666666; font-style: italic;">// Open the source directory to read in files</span>
    <span style="color: #000088;">$i</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> DirectoryIterator<span style="color: #009900;">&#40;</span><span style="color: #000088;">$src</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$i</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$f</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$f</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">isFile</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #990000;">rename</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$f</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getRealPath</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;<span style="color: #006699; font-weight: bold;">$dest</span>/&quot;</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$f</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getFilename</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #000088;">$f</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">isDot</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #000088;">$f</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">isDir</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            rmove<span style="color: #009900;">&#40;</span><span style="color: #000088;">$f</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getRealPath</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;<span style="color: #006699; font-weight: bold;">$dest</span>/<span style="color: #006699; font-weight: bold;">$f</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #990000;">unlink</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$f</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getRealPath</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #990000;">unlink</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$src</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre>
</div>
</div>
<p><strong>Recursively copy</strong></p>
<div class="wp_syntax">
<div class="code">
<pre class="php" style="font-family:monospace;"><span style="color: #009933; font-style: italic;">/**
 * Recursively copy files from one directory to another
 *
 * @param String $src - Source of files being moved
 * @param String $dest - Destination of files being moved
 */</span>
<span style="color: #000000; font-weight: bold;">function</span> rcopy<span style="color: #009900;">&#40;</span><span style="color: #000088;">$src</span><span style="color: #339933;">,</span> <span style="color: #000088;">$dest</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
&nbsp;
    <span style="color: #666666; font-style: italic;">// If source is not a directory stop processing</span>
    <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #990000;">is_dir</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$src</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #666666; font-style: italic;">// If the destination directory does not exist create it</span>
    <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #990000;">is_dir</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$dest</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #990000;">mkdir</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$dest</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #666666; font-style: italic;">// If the destination directory could not be created stop processing</span>
            <span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #666666; font-style: italic;">// Open the source directory to read in files</span>
    <span style="color: #000088;">$i</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> DirectoryIterator<span style="color: #009900;">&#40;</span><span style="color: #000088;">$src</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$i</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$f</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$f</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">isFile</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #990000;">copy</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$f</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getRealPath</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;<span style="color: #006699; font-weight: bold;">$dest</span>/&quot;</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$f</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getFilename</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #000088;">$f</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">isDot</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #000088;">$f</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">isDir</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            rcopy<span style="color: #009900;">&#40;</span><span style="color: #000088;">$f</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getRealPath</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;<span style="color: #006699; font-weight: bold;">$dest</span>/<span style="color: #006699; font-weight: bold;">$f</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre>
</div>
</div>
<p><strong>Recursively delete</strong></p>
<div class="wp_syntax">
<div class="code">
<pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> deleteDir<span style="color: #009900;">&#40;</span><span style="color: #000088;">$dir</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000088;">$iterator</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> RecursiveDirectoryIterator<span style="color: #009900;">&#40;</span><span style="color: #000088;">$dir</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> RecursiveIteratorIterator<span style="color: #009900;">&#40;</span><span style="color: #000088;">$iterator</span><span style="color: #339933;">,</span> RecursiveIteratorIterator<span style="color: #339933;">::</span><span style="color: #004000;">CHILD_FIRST</span><span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$file</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$file</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">isDir</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
         <span style="color: #990000;">rmdir</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$file</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getPathname</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
         <span style="color: #990000;">unlink</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$file</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getPathname</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #990000;">rmdir</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$dir</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre>
</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://help-php.com/php-5-recursively-move-copy-or-delete-files-and-folders/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>PHP library for parse and retrieve information from XLS files</title>
		<link>http://help-php.com/php-excel-parser/</link>
		<comments>http://help-php.com/php-excel-parser/#comments</comments>
		<pubDate>Sun, 02 Oct 2011 14:24:21 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[excel]]></category>
		<category><![CDATA[parser]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[xls]]></category>

		<guid isPermaLink="false">http://help-php.com/?p=257</guid>
		<description><![CDATA[It&#8217;s realy cool library, you don&#8217;t need PEAR library, or other&#8217;s files. Now you can parse your xls to array. Example of usage: &#60;?php require_once 'reader.php'; &#160; $filename=&#34;test.xls&#34;; $prod=parseExcel&#40;$filename&#41;; echo&#34;&#60;pre&#62;&#34;; print_r&#40;$prod&#41;; &#160; function parseExcel&#40;$excel_file_name_with_path&#41; &#123; $data = new Spreadsheet_Excel_Reader&#40;&#41;; // Set output Encoding. $data-&#62;setOutputEncoding&#40;'CP1251'&#41;; $data-&#62;read&#40;$excel_file_name_with_path&#41;; &#160; $colname=array&#40;'name','price','old_price','in_price','descr','status','sku','pos','stock','in_name','manufacturer','supplier','photo'&#41;; &#160; for &#40;$i = 1; $i &#60;= $data-&#62;sheets&#91;0&#93;&#91;'numRows'&#93;; ...]]></description>
			<content:encoded><![CDATA[<p><a href="http://help-php.com/wp-content/uploads/2011/10/php-excel-reader.jpg"><img class="aligncenter size-full wp-image-258" title="php-excel-reader" src="http://help-php.com/wp-content/uploads/2011/10/php-excel-reader.jpg" alt="" width="480" height="262" /></a><br />
It&#8217;s realy cool library, you don&#8217;t need PEAR library, or other&#8217;s files.<br />
Now you can parse your xls to array.<br />
<strong>Example of usage:</strong></p>
<div class="wp_syntax">
<div class="code">
<pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #b1b100;">require_once</span> <span style="color: #0000ff;">'reader.php'</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$filename</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;test.xls&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$prod</span><span style="color: #339933;">=</span>parseExcel<span style="color: #009900;">&#40;</span><span style="color: #000088;">$filename</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">echo</span><span style="color: #0000ff;">&quot;&lt;pre&gt;&quot;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">print_r</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$prod</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> parseExcel<span style="color: #009900;">&#40;</span><span style="color: #000088;">$excel_file_name_with_path</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #000088;">$data</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Spreadsheet_Excel_Reader<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #666666; font-style: italic;">// Set output Encoding.</span>
	<span style="color: #000088;">$data</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setOutputEncoding</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'CP1251'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$data</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">read</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$excel_file_name_with_path</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000088;">$colname</span><span style="color: #339933;">=</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'name'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'price'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'old_price'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'in_price'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'descr'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'status'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'sku'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'pos'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'stock'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'in_name'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'manufacturer'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'supplier'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'photo'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$i</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span> <span style="color: #000088;">$i</span> <span style="color: #339933;">&lt;=</span> <span style="color: #000088;">$data</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">sheets</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'numRows'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> <span style="color: #000088;">$i</span><span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$j</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span> <span style="color: #000088;">$j</span> <span style="color: #339933;">&lt;=</span> <span style="color: #000088;">$data</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">sheets</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'numCols'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> <span style="color: #000088;">$j</span><span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
			<span style="color: #000088;">$product</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$i</span><span style="color: #339933;">-</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$j</span><span style="color: #339933;">-</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">=</span><span style="color: #000088;">$data</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">sheets</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'cells'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$i</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$j</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
			<span style="color: #000088;">$product</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$i</span><span style="color: #339933;">-</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$colname</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$j</span><span style="color: #339933;">-</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">=</span><span style="color: #000088;">$data</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">sheets</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'cells'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$i</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$j</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span>
	<span style="color: #b1b100;">return</span> <span style="color: #000088;">$product</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre>
</div>
</div>
<p><a href="http://help-php.com/wp-content/uploads/2011/10/Excel.zip" title="Download PHP Excel library">Download PHP Excel library</a></p>
]]></content:encoded>
			<wfw:commentRss>http://help-php.com/php-excel-parser/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>CS-CART: Random banner rotation</title>
		<link>http://help-php.com/cs-cart-random-banner-rotation/</link>
		<comments>http://help-php.com/cs-cart-random-banner-rotation/#comments</comments>
		<pubDate>Tue, 20 Sep 2011 19:10:27 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[banner]]></category>
		<category><![CDATA[cs-cart]]></category>

		<guid isPermaLink="false">http://help-php.com/?p=236</guid>
		<description><![CDATA[Litle hack to rotate many banners in one block. First of all you need to add all your banners at block, and then open this file: /skins/THEME_NAME/customer/addons/banners/blocks/original.tpl and replace it contents with this: {* $Id: original.tpl 12696 2011-06-16 08:37:55Z alexions $ *} &#160; {** block-description:original **} &#123;assign var=randomindex value=$items&#124;@array_rand&#125; &#123;foreach from=$items item=&#34;banner&#34; key=&#34;key&#34;&#125; &#123;if $key==$randomindex&#125; ...]]></description>
			<content:encoded><![CDATA[<p><center><img src="http://help-php.com/wp-content/themes/theme-traject/includes/timthumb.php?src=/wp-content/uploads/2011/09/manage_banner_in_block.jpg&#038;w=593&#038;h=199&#038;zc=1" alt="" title="manage_banner_in_block"  class="aligncenter size-medium wp-image-238" /></center><br />
Litle hack to rotate many banners in one block. First of all you need to add all your banners at block, and then open this file:<br />
/skins/THEME_NAME/customer/addons/banners/blocks/original.tpl<span id="more-236"></span><br />
and replace it contents with this:</p>
<div class="wp_syntax">
<div class="code">
<pre class="smarty" style="font-family:monospace;"><span style="color: #008080; font-style: italic;">{* $Id: original.tpl 12696 2011-06-16 08:37:55Z alexions $ *}</span>
&nbsp;
<span style="color: #008080; font-style: italic;">{** block-description:original **}</span>
<span style="color: #D36900;">&#123;</span><span style="color: #008000;">assign</span> var<span style="color: #D36900;">=</span>randomindex <span style="color: #6A0A0A;">value</span><span style="color: #D36900;">=</span><span style="color: #00aaff;">$items</span>|@array_rand<span style="color: #D36900;">&#125;</span>
<span style="color: #D36900;">&#123;</span><span style="color: #0600FF;">foreach</span> <span style="color: #6A0A0A;">from</span><span style="color: #D36900;">=</span><span style="color: #00aaff;">$items</span> <span style="color: #6A0A0A;">item</span><span style="color: #D36900;">=</span><span style="color: #ff0000;">&quot;banner&quot;</span> <span style="color: #6A0A0A;">key</span><span style="color: #D36900;">=</span><span style="color: #ff0000;">&quot;key&quot;</span><span style="color: #D36900;">&#125;</span>
<span style="color: #D36900;">&#123;</span><span style="color: #0600FF;">if</span> <span style="color: #00aaff;">$key</span><span style="color: #D36900;">==</span><span style="color: #00aaff;">$randomindex</span><span style="color: #D36900;">&#125;</span>
	<span style="color: #D36900;">&#123;</span><span style="color: #0600FF;">if</span> <span style="color: #00aaff;">$banner</span>.<span style="color: #006600;">type</span> <span style="color: #D36900;">==</span> <span style="color: #ff0000;">&quot;G&quot;</span> &amp;&amp; <span style="color: #00aaff;">$banner</span>.<span style="color: #006600;">main_pair</span>.<span style="color: #006600;">image_id</span><span style="color: #D36900;">&#125;</span>
	<span style="color: #009000;">&lt;div class=&quot;ad-container center&quot;&gt;</span>
		<span style="color: #D36900;">&#123;</span><span style="color: #0600FF;">if</span> <span style="color: #00aaff;">$banner</span>.<span style="color: #006600;">url</span> <span style="color: #D36900;">!=</span> <span style="color: #ff0000;">&quot;&quot;</span><span style="color: #D36900;">&#125;</span><span style="color: #009000;">&lt;a href=&quot;{$banner.url|fn_url}&quot; {if $banner.target == &quot;B&quot;}target=&quot;_blank&quot;{/if}&gt;</span><span style="color: #D36900;">&#123;</span><span style="color: #D36900;">/</span><span style="color: #0600FF;">if</span><span style="color: #D36900;">&#125;</span>
		<span style="color: #D36900;">&#123;</span><span style="color: #0600FF;">include</span> <span style="color: #6A0A0A;">file</span><span style="color: #D36900;">=</span><span style="color: #ff0000;">&quot;common_templates/image.tpl&quot;</span> images<span style="color: #D36900;">=</span><span style="color: #00aaff;">$banner</span>.<span style="color: #006600;">main_pair</span> object_type<span style="color: #D36900;">=</span><span style="color: #ff0000;">&quot;common&quot;</span><span style="color: #D36900;">&#125;</span>
		<span style="color: #D36900;">&#123;</span><span style="color: #0600FF;">if</span> <span style="color: #00aaff;">$banner</span>.<span style="color: #006600;">url</span> <span style="color: #D36900;">!=</span> <span style="color: #ff0000;">&quot;&quot;</span><span style="color: #D36900;">&#125;</span><span style="color: #009000;">&lt;/a&gt;</span><span style="color: #D36900;">&#123;</span><span style="color: #D36900;">/</span><span style="color: #0600FF;">if</span><span style="color: #D36900;">&#125;</span>
	<span style="color: #009000;">&lt;/div&gt;</span>
	<span style="color: #D36900;">&#123;</span><span style="color: #0600FF;">else</span><span style="color: #D36900;">&#125;</span>
		<span style="color: #009000;">&lt;div class=&quot;wysiwyg-content&quot;&gt;</span>
			<span style="color: #D36900;">&#123;</span><span style="color: #00aaff;">$banner</span>.<span style="color: #006600;">description</span>|unescape<span style="color: #D36900;">&#125;</span>
		<span style="color: #009000;">&lt;/div&gt;</span>
	<span style="color: #D36900;">&#123;</span><span style="color: #D36900;">/</span><span style="color: #0600FF;">if</span><span style="color: #D36900;">&#125;</span>
<span style="color: #D36900;">&#123;</span><span style="color: #D36900;">/</span><span style="color: #0600FF;">if</span><span style="color: #D36900;">&#125;</span>
<span style="color: #D36900;">&#123;</span><span style="color: #D36900;">/</span><span style="color: #0600FF;">foreach</span><span style="color: #D36900;">&#125;</span></pre>
</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://help-php.com/cs-cart-random-banner-rotation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP-based admin tool to manage SQLite databases</title>
		<link>http://help-php.com/php-based-admin-tool-to-manage-sqlite-databases/</link>
		<comments>http://help-php.com/php-based-admin-tool-to-manage-sqlite-databases/#comments</comments>
		<pubDate>Fri, 16 Sep 2011 19:13:16 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[SQLite]]></category>
		<category><![CDATA[SQLite manager]]></category>

		<guid isPermaLink="false">http://help-php.com/?p=231</guid>
		<description><![CDATA[phpLiteAdmin is a web-based SQLite database admin tool written in PHP with support for SQLite2 and SQLite3. Following in the spirit of the flat-file system used by SQLite, phpLiteAdmin consists of a single 100KB source file that is dropped into a directory on a server and then visited in a browser. Setup is as simple ...]]></description>
			<content:encoded><![CDATA[<p><center><img src="http://help-php.com/wp-content/uploads/2011/09/sn1-300x195.png" alt="" title="sn1" width="300" height="195" class="aligncenter size-medium wp-image-232" /></center><br />
phpLiteAdmin is a web-based SQLite database admin tool written in PHP with support for SQLite2 and SQLite3. Following in the spirit of the flat-file system used by SQLite, phpLiteAdmin consists of a single 100KB source file that is dropped into a directory on a server and then visited in a browser. Setup is as simple as specifying which databases to manage and creating a password. The available operations, feature set, interface, and user experience is comparable to that of phpMyAdmin.</p>
<p><a href="http://code.google.com/p/phpliteadmin/" target="_blank">Project page</a></p>
]]></content:encoded>
			<wfw:commentRss>http://help-php.com/php-based-admin-tool-to-manage-sqlite-databases/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Management  autoload services in CentOS</title>
		<link>http://help-php.com/management-autoload-services-in-centos/</link>
		<comments>http://help-php.com/management-autoload-services-in-centos/#comments</comments>
		<pubDate>Thu, 15 Sep 2011 10:52:21 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[autorun]]></category>

		<guid isPermaLink="false">http://help-php.com/?p=226</guid>
		<description><![CDATA[To add a service at startup OS CentOS / RHEL you need a chkconfig  serice chkconfig –list &#60;service name&#62; chkconfig –add &#60;service name&#62; chkconfig –del &#60;service name&#62; chkconfig [--level levels] &#60;service name&#62; &#60;on&#124;off&#124;reset&#62; chkconfig [--level levels] &#60;service name&#62; # chkconfig --list httpd (checking whether to autostart httpd) httpd 0:off 1:off 2:off 3:off 4:off 5:off 6:off # chkconfig --level 35 httpd on (include ...]]></description>
			<content:encoded><![CDATA[<p><center><img src="http://help-php.com/wp-content/uploads/2011/09/chkconfig-output.png" alt="" title="chkconfig output" width="636" height="320" class="aligncenter size-full wp-image-227" /></center><br />
To add a service at startup OS CentOS / RHEL you need a <strong>chkconfig  </strong>serice<br />
<span id="more-226"></span></p>
<ul>
<li>chkconfig –list &lt;service name&gt;</li>
<li>chkconfig –add &lt;service name&gt;</li>
<li>chkconfig –del &lt;service name&gt;</li>
<li>chkconfig [--level levels] &lt;service name&gt; &lt;on|off|reset&gt;</li>
<li>chkconfig [--level levels] &lt;service name&gt;</li>
</ul>
<div class="wp_syntax">
<div class="code">
<pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># chkconfig --list httpd (checking whether to autostart httpd)</span>
httpd              <span style="color: #000000;">0</span>:off   <span style="color: #000000;">1</span>:off   <span style="color: #000000;">2</span>:off    <span style="color: #000000;">3</span>:off   <span style="color: #000000;">4</span>:off    <span style="color: #000000;">5</span>:off    <span style="color: #000000;">6</span>:off</pre>
</div>
</div>
<div class="wp_syntax">
<div class="code">
<pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># chkconfig --level 35 httpd on (include the level of performance 3 and 5)</span>
<span style="color: #666666; font-style: italic;"># chkconfig --list httpd (checking)</span>
&nbsp;
httpd              <span style="color: #000000;">0</span>:off    <span style="color: #000000;">1</span>:off    <span style="color: #000000;">2</span>:off    <span style="color: #000000;">3</span>:on <span style="color: #000000;">4</span>:off    <span style="color: #000000;">5</span>:on <span style="color: #000000;">6</span>:off</pre>
</div>
</div>
<div class="wp_syntax">
<div class="code">
<pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># chkconfig --level 35 httpd off (disable autoload)</span>
<span style="color: #666666; font-style: italic;"># chkconfig --del httpd (delete service)</span>
<span style="color: #666666; font-style: italic;"># chkconfig --list httpd (checking)</span>
<span style="color: #666666; font-style: italic;"># chkconfig --add httpd (adding to autoload)</span></pre>
</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://help-php.com/management-autoload-services-in-centos/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Convert timestamp to date in MYSQL</title>
		<link>http://help-php.com/convert-timestamp-to-date-in-mysql/</link>
		<comments>http://help-php.com/convert-timestamp-to-date-in-mysql/#comments</comments>
		<pubDate>Fri, 09 Sep 2011 14:32:49 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[convert date]]></category>
		<category><![CDATA[date]]></category>
		<category><![CDATA[timestamp]]></category>

		<guid isPermaLink="false">http://help-php.com/?p=216</guid>
		<description><![CDATA[SELECT DATE&#40;FROM_UNIXTIME&#40;`date_add`&#41;&#41; AS dateAdd FROM TABLE]]></description>
			<content:encoded><![CDATA[<p><center><img src="http://help-php.com/wp-content/uploads/2011/09/1.png" alt="" title="MySQL convert timestamp to date"  class="aligncenter size-full wp-image-217" /></center><br />
<span id="more-216"></span></p>
<div class="wp_syntax">
<div class="code">
<pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">SELECT</span> <span style="color: #993333; font-weight: bold;">DATE</span><span style="color: #66cc66;">&#40;</span>FROM_UNIXTIME<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">`date_add`</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">AS</span> dateAdd <span style="color: #993333; font-weight: bold;">FROM</span> <span style="color: #993333; font-weight: bold;">TABLE</span></pre>
</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://help-php.com/convert-timestamp-to-date-in-mysql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cross browser testing with Saucelabs</title>
		<link>http://help-php.com/cross-browser-testing-with-saucelabs/</link>
		<comments>http://help-php.com/cross-browser-testing-with-saucelabs/#comments</comments>
		<pubDate>Thu, 08 Sep 2011 17:33:37 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Online services]]></category>
		<category><![CDATA[browser]]></category>
		<category><![CDATA[testing]]></category>

		<guid isPermaLink="false">http://help-php.com/?p=208</guid>
		<description><![CDATA[It&#8217;s really cool service which I found for myself today. It allows to test your website from different browsers, but its main difference from other services is that it allows you to manage browser. It run&#8217;s something like virtual machine with browser, that you selected and allows you work with it, like it&#8217;s run in ...]]></description>
			<content:encoded><![CDATA[<p><center><img src="http://help-php.com/wp-content/uploads/2011/09/11.jpg" alt="" title="Cross browser site testing"  class="aligncenter size-full wp-image-209" /></center><br />
It&#8217;s really cool service which I found for myself today. It allows to test your website from different browsers, but its main difference from other services is that it allows you to manage browser. It run&#8217;s something like virtual machine with browser, that you selected and allows you work with it, like it&#8217;s run in your PC. Saucelabs also has Firefox and Chrome plugins, with them you can run opened page in other browser.<br />
<center><a href="http://help-php.com/wp-content/uploads/2011/09/33s34.jpg"><img src="http://help-php.com/wp-content/uploads/2011/09/33s34.jpg" alt="" title="cross browser testing" width="426" height="702" class="aligncenter size-full wp-image-210" /></a></center><br />
Service has different account types, and also has a free account type with some restrictions.<br />
<strong>Service url:</strong> <a href="https://saucelabs.com" target="_blank">https://saucelabs.com</a></p>
]]></content:encoded>
			<wfw:commentRss>http://help-php.com/cross-browser-testing-with-saucelabs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Disable innodb in mysql 5.5.x</title>
		<link>http://help-php.com/mysql-disable-innodb/</link>
		<comments>http://help-php.com/mysql-disable-innodb/#comments</comments>
		<pubDate>Sun, 21 Aug 2011 07:31:46 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[innodb]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[tuning]]></category>

		<guid isPermaLink="false">http://help-php.com/?p=147</guid>
		<description><![CDATA[if skip-innodb didn&#8217;t help you, try to add this into yours my.cnf ignore_builtin_innodb default_storage_engine=MyISAM]]></description>
			<content:encoded><![CDATA[<p>if skip-innodb didn&#8217;t help you, try to add this into yours <strong>my.cnf</strong></p>
<div class="wp_syntax">
<div class="code">
<pre class="bash" style="font-family:monospace;">ignore_builtin_innodb
<span style="color: #007800;">default_storage_engine</span>=MyISAM</pre>
</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://help-php.com/mysql-disable-innodb/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>PHP automate creation of images for CSS sprites.</title>
		<link>http://help-php.com/php-automate-creation-of-images-for-css-sprites/</link>
		<comments>http://help-php.com/php-automate-creation-of-images-for-css-sprites/#comments</comments>
		<pubDate>Wed, 03 Aug 2011 12:24:01 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://help-php.com/?p=144</guid>
		<description><![CDATA[I use imagefilter to create images for CSS sprites on the fly. This is part of my code: $image_path = $targetFile; //path to your image $img=file_get_contents&#40;$image_path&#41;; //this is some trick to use imagecreatefromstring, because i don't know what type of image will be uploaded -jpg,png or else... $input_image = imagecreatefromstring&#40;$img&#41;; $input_image_2 = imagecreatefromstring&#40;$img&#41;; &#160; $image_info ...]]></description>
			<content:encoded><![CDATA[<p><img class="aligncenter size-full wp-image-160" style="border-style: initial; border-color: initial;" title="flower-sample" src="http://help-php.com/wp-content/uploads/2011/08/flower-sample.gif" alt="" width="288" height="144" /><br />
I use imagefilter to create images for CSS sprites on the fly. This is part of my code:<br />
<span id="more-144"></span></p>
<div class="wp_syntax">
<div class="code">
<pre class="php" style="font-family:monospace;"><span style="color: #000088;">$image_path</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$targetFile</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//path to your image</span>
<span style="color: #000088;">$img</span><span style="color: #339933;">=</span><span style="color: #990000;">file_get_contents</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$image_path</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//this is some trick to use imagecreatefromstring, because i don't know what type of image will be uploaded -jpg,png or else...</span>
<span style="color: #000088;">$input_image</span> <span style="color: #339933;">=</span> <span style="color: #990000;">imagecreatefromstring</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$img</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$input_image_2</span> <span style="color: #339933;">=</span> <span style="color: #990000;">imagecreatefromstring</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$img</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$image_info</span> <span style="color: #339933;">=</span> <span style="color: #990000;">getimagesize</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$image_path</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$output_image</span> <span style="color: #339933;">=</span> <span style="color: #990000;">imagecreatetruecolor</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$image_info</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$image_info</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">*</span> <span style="color: #cc66cc;">2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">imagefilter</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$input_image_2</span><span style="color: #339933;">,</span> IMG_FILTER_GRAYSCALE<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    	<span style="color: #990000;">imagecopy</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$output_image</span><span style="color: #339933;">,</span> <span style="color: #000088;">$input_image_2</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #000088;">$image_info</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$image_info</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
 <span style="color: #666666; font-style: italic;">// error report</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #990000;">imagecopy</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$output_image</span><span style="color: #339933;">,</span> <span style="color: #000088;">$input_image</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #000088;">$image_info</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #000088;">$image_info</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$image_info</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">imagepng</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$output_image</span><span style="color: #339933;">,</span> <span style="color: #000088;">$targetFile</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'.png'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">imagedestroy</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$input_image</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">imagedestroy</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$output_image</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre>
</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://help-php.com/php-automate-creation-of-images-for-css-sprites/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL error InnoDB: Unable to lock ./ibdata1, error: 11</title>
		<link>http://help-php.com/mysql-error-innodb/</link>
		<comments>http://help-php.com/mysql-error-innodb/#comments</comments>
		<pubDate>Thu, 28 Jul 2011 10:45:21 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://help-php.com/?p=141</guid>
		<description><![CDATA[Mysql error &#8220;InnoDB: Unable to lock ./ibdata1, error: 11&#8243; You need to create copies of original files (ibdata1, ib_logfile0, ib_logfile1&#8230; – error may be associated with many files, but the solution is the same). mv /var/lib/mysql/ibdata1 /var/lib/mysql/ibdata1.bak cp -a /var/lib/mysql/ibdata1.bak /var/lib/mysql/ibdata1]]></description>
			<content:encoded><![CDATA[<p><a href="http://help-php.com/wp-content/uploads/2011/07/symbol-error1.png"><img class="aligncenter size-full wp-image-157" title="symbol-error" src="http://help-php.com/wp-content/uploads/2011/07/symbol-error1.png" alt="" width="256" height="256" /></a><br />
<strong>Mysql error &#8220;InnoDB: Unable to lock ./ibdata1, error: 11&#8243;</strong><br />
You need to create copies of original files (ibdata1, ib_logfile0, ib_logfile1&#8230; – error may be associated with many files, but the solution is the same).</p>
<div class="wp_syntax">
<div class="code">
<pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">mv</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>mysql<span style="color: #000000; font-weight: bold;">/</span>ibdata1 <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>mysql<span style="color: #000000; font-weight: bold;">/</span>ibdata1.bak
<span style="color: #c20cb9; font-weight: bold;">cp</span> <span style="color: #660033;">-a</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>mysql<span style="color: #000000; font-weight: bold;">/</span>ibdata1.bak <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>mysql<span style="color: #000000; font-weight: bold;">/</span>ibdata1</pre>
</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://help-php.com/mysql-error-innodb/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

