You are here: php class « All PHP « IT news, forums, messages
php class

Posted by severin on 01/09/07 10:31

Hi,

I'm trying to format a timestamp in "french" date.


_________________________________________________________________
$jour = Array(
'mon' => 'lundi',
'tue' => 'mardi',
'wen' => 'mercredi',
'thu' => 'jeudi',
'fri' => 'vendredi',
'sat' => 'samedi',
'sun' => 'dimanche'
);

then:
$jour[ date( "d" , mytimestamp )];
returns a french day.
__________________________________________________________________

but i'm trying (begining) to work with classes:

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)

Thx.

 

Navigation:

[Reply to this 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

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