Connecting Tech Pros Worldwide Help | Site Map

Classes in PHP

Ameen_France
Guest
 
Posts: n/a
#1: Jan 27 '06
Can anybody help me by giving some examples for classes in PHP. please
provide me some simple and understandable classes examples.
regards
Ameen

Carl Vondrick
Guest
 
Posts: n/a
#2: Jan 27 '06

re: Classes in PHP


Ameen_France wrote:[color=blue]
> Can anybody help me by giving some examples for classes in PHP. please
> provide me some simple and understandable classes examples.
> regards
> Ameen
>[/color]

Try these:
-
http://www.google.com/search?q=php+o...en-US:official
http://www.google.com/search?hs=ntL&...es&btnG=Search
-
http://www.google.com/search?hs=dE1&...op&btnG=Search

Carl
Double Echo
Guest
 
Posts: n/a
#3: Jan 27 '06

re: Classes in PHP


Ameen_France wrote:[color=blue]
> Can anybody help me by giving some examples for classes in PHP. please
> provide me some simple and understandable classes examples.
> regards
> Ameen
>[/color]

http://www.phpclasses.org

Jon
Guest
 
Posts: n/a
#4: Jan 27 '06

re: Classes in PHP


They're very simliar to that of C++ really. You use the new keyword to
instanciate a class within an application, and class data is handled the
same way as in C++ (for the most part). If you know OO programming, a google
search should be all you need to write PHP classes (just to get the syntax
down).

"Ameen_France" <ameen.pondy@gmail.com> wrote in message
news:1138340785.566362.284920@g44g2000cwa.googlegr oups.com...[color=blue]
> Can anybody help me by giving some examples for classes in PHP. please
> provide me some simple and understandable classes examples.
> regards
> Ameen
>[/color]


s a n j a y
Guest
 
Posts: n/a
#5: Jan 28 '06

re: Classes in PHP


Ameen_France wrote:[color=blue]
> Can anybody help me by giving some examples for classes in PHP. please
> provide me some simple and understandable classes examples.
> regards
> Ameen
>[/color]


well do you have any experience with OO programming? If you do not you
might wanna pick up a OO book. You can even pick up a java or C++ book
and read the classes and objects chapter. PHP classes are based on these
languages anyway.

Sanjay
Jim Michaels
Guest
 
Posts: n/a
#6: Feb 7 '06

re: Classes in PHP


I got this from the user notes in the manual.

A class to encrypt, decrypt data! if you have problems with using it please
visit my site http://www.alexandrub.tk and mail me using Contact section! I
use it to encrypt POST and GET data! I don't remember his name but thanks to
how recognize his code in the binFromHex function!
<?php
//copyright www.alexandrub.tk
//ver 1.00
class cript {
var $key;
var $td;
var $time4keyToChange;
var $iv;
function cript($aKey='time',$aTime4keyToChange=3600) { //constructor
$this->time4keyToChange=$aTime4keyToChange;
if($aKey!='time') {
$this->key=$aKey."&".intval(time()/$this->time4keyToChange);
} else {
$this->key=intval(time()/$this->time4keyToChange);
}
$this->td = MCRYPT_RIJNDAEL_256;
$this->iv = "qe3jigneqfrgnqw2egfmas4qetjkn5lg";
}
function hexFromBin($data) {
return bin2hex($data);
}
function binFromHex($data) {
$len = strlen($data);
return pack("H" . $len, $data);
}
function criptData($data) {
return $this->hexFromBin(mcrypt_encrypt($this->td, $this->key,
$data, MCRYPT_MODE_CBC, $this->iv));
}
function decriptData($eData) {
return trim(mcrypt_decrypt($this->td, $this->key,
$this->binFromHex($eData), MCRYPT_MODE_CBC, $this->iv));
}
}
return true;
?>


Closed Thread


Similar PHP bytes