Skip to content

Instantly share code, notes, and snippets.

View med-amin's full-sized avatar
🏠
Working from home

Mohamed Amine med-amin

🏠
Working from home
View GitHub Profile
name price
Skewers - Bamboo 108.31
Carbonated Water - Strawberry 193.50
Thermometer Digital 243.78
Wine - Mondavi Coastal Private 248.55
Island Oasis - Mango Daiquiri 123.18
Anisette - Mcguiness 230.41
Watercress 231.60
Puree - Guava 45.76
Beans - Navy, Dry 214.07
<?php
namespace TestModule\TestDate\Model\Config\Source;
use Magento\Framework\App\ObjectManager;
use Magento\Store\Model\StoreManagerInterface;
use Magento\Eav\Model\Entity\Attribute\Source\AbstractSource;
class TestDate extends AbstractSource
{
<?php
/**
* Copyright © 2018 . All rights reserved.
*/
namespace Test\Test\Setup;
use Magento\Customer\Model\Customer;
use Magento\Customer\Setup\CustomerSetupFactory;
use Magento\Eav\Model\Entity\Attribute\SetFactory as AttributeSetFactory;
use Magento\Framework\Setup\InstallDataInterface;
<?php
$databasehost = "localhost";
$databasename = "test";
$databasetable = "sample";
$databaseusername ="test";
$databasepassword = "";
$fieldseparator = ",";
$lineseparator = "\n";
$csvfile = "filename.csv";
<form action="" method="post" accept-charset="utf-8" enctype="multipart/form-data">
<input type="file" name="file">
<input type="submit" name="btn_submit" value="Upload File" />
<?php
if(ISSET($_POST['btn_submit'])){
$file = fopen($_FILES['file']['tmp_name'], 'r+');
while (($column = fgetcsv($file, 10000, ";")) !== FALSE) {
print_r($column);die();