Skip to content

Instantly share code, notes, and snippets.

View ChStram's full-sized avatar

Charlie Stram ChStram

  • France
View GitHub Profile
<?php
/**
* Télécharge un fichier CSV avec les données fournies.
*
* @param string $fileName Nom du fichier à télécharger.
* @param array $dataRows Données à écrire dans le CSV (tableau de tableaux).
*/
function downloadCsvFile( $fileName, $dataRows ) {
if ( headers_sent() ) {
wp_die( 'Headers already sent. Cannot download file.' );
@ChStram
ChStram / invoice.php
Created February 27, 2017 20:59
Obtenir le prix HT à partir d'un prix TTC
<?php
function get_price_ht($price_ttc, $taux = '20')
{
$price_ht = $price_ttc / ( 1 + ($taux / 100) ) ;
return number_format($price_ht, 2) ;
}
echo get_price_ht(100) ; // Retourne 83.33
<?php dynamic_sidebar( 'sidebar_id_unique' ); ?>