Skip to content

Instantly share code, notes, and snippets.

@fadupla
fadupla / maintenance.php
Created Feb 5, 2018 — forked from bjornjohansen/maintenance.php
Custom WordPress maintenance mode page
View maintenance.php
<?php
wp_load_translations_early();
$protocol = wp_get_server_protocol();
header( "$protocol 503 Service Unavailable", true, 503 );
header( 'Content-Type: text/html; charset=utf-8' );
header( 'Retry-After: 30' );
?>
<!DOCTYPE html>
<html>
@fadupla
fadupla / csv_to_array.php
Created Mar 8, 2016 — forked from jaywilliams/csv_to_array.php
Convert a comma separated file into an associated array.
View csv_to_array.php
<?php
/**
* Convert a comma separated file into an associated array.
* The first row should contain the array keys.
*
* Example:
*
* @param string $filename Path to the CSV file
* @param string $delimiter The separator used in the file
* @return array
You can’t perform that action at this time.