read csv file to array in php

 $abcfile = ABSPATH.'wp-content/themes/xpendy/subscriptions17.csv';

        // print( $abcfile.'<br>' );

        $count = 0;

if (($open = fopen($abcfile, "r")) !== FALSE) 

  {

     echo "123<pre>";

  

    while (($data = fgetcsv($open, 1000, ",")) !== FALSE) 

    {

    // if ($data[27] != '4.95' && $data[31] != 'Subscription') {

       // print_r($data);

       $inscou = $wpdb->insert('table2',

        array(

          'orderid' => $data[0],

          'emailid' => $data[12]

          

        ));

        // if ($inscou) {

        //    $count = $count + 1;

        //  } 

      // }

     //print_r($data);       

      // $array[] = $data; 

    }

  

    fclose($open);

  }

  die('pk');

  // echo "<pre>";

  //To display array data

  // var_dump($array);

  // echo "</pre>";

Comments

Popular posts from this blog

Add Css And Js Files on Specific Page In laravel

Xpendy Pending

Laravel Join with two coloums