Posted by Michael Fesser on 01/09/07 10:46
..oO(severin)
>I'm trying to format a timestamp in "french" date.
>[...]
>
>class myformat(){
> var $mytime;
> function myformat( $atimestamp ){
> $this->mytime = $atimestamp;
> }
> function mydate(){
> //********************************
> //******** here is the "bug" **************
> //******************************************
> echo $jour[ date('d',$this->mytime)];
> }
>}
>
>
>=> ERROR, $jour is not accessible.
>
>What is the most appropriate syntax( PHP 4)
$jour is not accessible inside the mydate() method unless you make it
visible by using the 'global' keyword:
function mydate()
global $jour;
...
}
Another option might be setlocale() to let PHP return localized date
informations.
Micha
[Back to original message]
|