Skip to content

Instantly share code, notes, and snippets.

@ardani
ardani / .htaccess
Created March 30, 2016 00:29
CORS htaccess support lumen and framework
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine On
# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [L,R=301]
@lastguest
lastguest / excel_to_array.php
Created April 3, 2014 16:43
Read an Excel sheet as PHP array. (Needs PHPExcel)
<?php
// Needs PHPExcel
// https://phpexcel.codeplex.com/
function excel_to_array($inputFileName,$row_callback=null){
if (!class_exists('PHPExcel')) return false;
try {
$inputFileType = PHPExcel_IOFactory::identify($inputFileName);
$objReader = PHPExcel_IOFactory::createReader($inputFileType);
$objPHPExcel = $objReader->load($inputFileName);