3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * Returns the day name according to the current locale * * @param int $n The day number (ISO-8601 numeric representation) * @param string $lc The desired locale for the returned day name * * @return string The day name */ function day_name(int $n, string $lc = "en_GB") { // Store the current locale so that we can reset it $olc = setlocale(LC_TIME, "0"); // Set the locale according to the $locale passed in setlocale(LC_TIME, $lc); // Get the day name according to the $locale passed in $output = strftime("%A", strtotime("Last Sunday +{$n} days")); // Reset the locale setLocale(LC_TIME, $olc); // Return the day name return $output; } echo day_name(4, "fr_FR");
Output for git.master, git.master_jit, rfc.property-hooks
Deprecated: Function strftime() is deprecated in /in/pj1DH on line 20 jeudi

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
49.23 ms | 401 KiB | 8 Q