Question set result moth in correct language.

I’m working on a very small script. This script will update my time on the website with the date of last saturday.
I have this as my code:
[php]

<?php $last_sat = strtotime("last Saturday"); $resultdate = date('d-F-Y',$last_sat); echo ($resultdate); ?>

[/php]

I want to replace the variable F with the correct spelling in the right language.
Example: When I run the script now I get back, 23-june-2012.
My website is also in Dutch en German.
So I want to replace june in juni voor dutch.

Can some one put me in the right direction with this challenge? 8)

I’ am new to PHP. ;D

Thanks,

Alexander

You need to use the locale-sensitive alternate function to date() - strftime()

[php]$last_sat = strtotime(“last Saturday”);
setlocale(LC_TIME, ‘German’);
echo strftime("%#d %B %Y",$last_sat);
[/php]

Sponsor our Newsletter | Privacy Policy | Terms of Service