PHP SOLUTIONS

This is the blog for getting Idea regarding PHP, Magento, jQuery and JavaScript for Customization.

Monday 31 March 2014

Magento Images not displayed in Admin

HI,

    Some times in Magento create amazing issues, in admin or for fornt end also

    Recently, I am getting this type of issue, In side admin I can't see the product images after the Inserting the product

Product Images no display in admin


for solve this type of issue

Just open media directory using FTP and just change the name of .htaccess to .htaccess_old

And you have solve the Image issue.

Enjoy::::
,

Friday 28 March 2014

PHP : Read CSV file line by line

There are 2 type for read CSV file using PHP script.

Method 1 ::

Using this can read CSV line by line, can get any number of cell value

$line = 1;
$csv = array(); //new array.
if (($handle = fopen("test.csv", "r")) !== FALSE) { // Read csv file
    while (($obj = fgetcsv($handle, 1000, ",")) !== FALSE) {
        $num = count($obj);
        echo "<label> $num fields in line $row: <br /></label>\n";
        $line++;
        for ($i=0; $i < $num; $i++) {
            echo $obj[$i] . "<br />\n";
        }
        $csv[] = $obj;
    }
    fclose($handle);
}
echo $csv[2][1]; //prints the 3th row, second column.



If want to get Array of the CSV then use Method 2 here,