Reply to Re: php class

Your name:

Reply:


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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация