Search
 
SCRIPT & CODE EXAMPLE
 

PHP

convertir date php en français

// Convertit une date ou un timestamp en français
public static function dateToFrench($date, $format) 
{
    $english_days = array('Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday');
    $french_days = array('lundi', 'mardi', 'mercredi', 'jeudi', 'vendredi', 'samedi', 'dimanche');
    $english_months = array('January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December');
    $french_months = array('janvier', 'février', 'mars', 'avril', 'mai', 'juin', 'juillet', 'août', 'septembre', 'octobre', 'novembre', 'décembre');
    return str_replace($english_months, $french_months, str_replace($english_days, $french_days, date($format, strtotime($date) ) ) );
}
Comment

PREVIOUS NEXT
Code Example
Php :: Call Python From PHP And Get Return Code 
Php :: isset in php 
Php :: test in laravel 
Php :: laravel add many to many 
Php :: magento 2 add in static block 
Php :: run phpstan terminal 
Php :: laravel How to include model attribute automatically 
Php :: php get the two number of time second 
Php :: pass the product name to form field cf7 woocommerce 
Php :: @yield laravel 
Php :: coinbase commerce laravel 
Php :: return pdft download and back with msg in laravel 
Php :: send email php form 
Php :: overloading and overriding in php 
Php :: laravel log query for model (full) 
Php :: how to add image in wordpress theme 
Php :: generate a unique id 
Php :: wordpress if page 
Php :: parseint php 
Php :: get ids from object 
Php :: Merge Two Collection 
Php :: check dir php 
Php :: wordpress access database php 
Php :: validate file exist php 
Php :: scss laravel 
Php :: docker compose php 
Php :: Laravel storage:link not working 
Php :: query builder codeigniter 
Php :: get firstwod php 
Php :: check if is the last day of the month php 
ADD CONTENT
Topic
Content
Source link
Name
7+1 =