tepisenordek
08-11-2007, 21:05 PM
Asağıdaki kod parçası ile bu çevrim kolayca yapılabilir,
PHP:
1.
2. <?php
3. class cevir {
4. //Derece Santigrattan Derece Fahrenayta,
5.
6. function C2F ($derece) {
7.
8. return (1.8 * $derece)+32;
9. }
10. }
11. ?>
Ornek bir kullanim:
PHP:
1.
2. <?php
3. echo cevir::C2F(100);
4. ?>
PHP:
1.
2. <?php
3. class cevir {
4. //Derece Santigrattan Derece Fahrenayta,
5.
6. function C2F ($derece) {
7.
8. return (1.8 * $derece)+32;
9. }
10. }
11. ?>
Ornek bir kullanim:
PHP:
1.
2. <?php
3. echo cevir::C2F(100);
4. ?>