473,396 Members | 2,010 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Classes in PHP

Can anybody help me by giving some examples for classes in PHP. please
provide me some simple and understandable classes examples.
regards
Ameen

Jan 27 '06 #1
5 1276
Ameen_France wrote:
Can anybody help me by giving some examples for classes in PHP. please
provide me some simple and understandable classes examples.
regards
Ameen


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
Jan 27 '06 #2
Ameen_France wrote:
Can anybody help me by giving some examples for classes in PHP. please
provide me some simple and understandable classes examples.
regards
Ameen


http://www.phpclasses.org

Jan 27 '06 #3
Jon
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" <am*********@gmail.com> wrote in message
news:11**********************@g44g2000cwa.googlegr oups.com...
Can anybody help me by giving some examples for classes in PHP. please
provide me some simple and understandable classes examples.
regards
Ameen

Jan 27 '06 #4
Ameen_France wrote:
Can anybody help me by giving some examples for classes in PHP. please
provide me some simple and understandable classes examples.
regards
Ameen

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
Jan 28 '06 #5
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;
?>
Feb 7 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Bob Rock | last post by:
Hello, in the last few days I've made my first few attempts at creating mixed C++ managed-unmanaged assemblies and looking aftwerwards with ILDASM at what is visible in those assemblies from a...
9
by: Jack | last post by:
Hello I have a library of calculationally intensive classes that is used both by a GUI based authoring application and by a simpler non-interactive rendering application. Both of these...
9
by: Aguilar, James | last post by:
I know that one can define an essentially unlimited number of classes in a file. And one can declare just as many in a header file. However, the question I have is, should I? Suppose that, to...
12
by: Langy | last post by:
Hello I'm fairly new to C++ but have programmed several other languages and found most of c++ fairly easy (so far!). I've come to a tutorial on classes, could someone please tell me why you...
4
by: john townsley | last post by:
do people prefer to design classes for the particular job or for a rangle of tasks they might encounter now and in the future. i am doing some simple win32 apps and picking classes is simple, but...
2
by: joye | last post by:
Hello, My question is how to use C# to call the existing libraries containing unmanaged C++ classes directly, but not use C# or managed C++ wrappers unmanaged C++ classes? Does anyone know how...
18
by: Edward Diener | last post by:
Is the packing alignment of __nogc classes stored as part of the assembly ? I think it must as the compiler, when referencing the assembly, could not know how the original data is packed otherwise....
6
by: ivan.leben | last post by:
I want to write a Mesh class using half-edges. This class uses three other classes: Vertex, HalfEdge and Face. These classes should be linked properly in the process of building up the mesh by...
0
by: ivan.leben | last post by:
I am writing this in a new thread to alert that I found a solution to the problem mentioned here: http://groups.google.com/group/comp.lang.c++/browse_thread/thread/7970afaa089fd5b8 and to avoid...
2
by: Amu | last post by:
i have a dll ( template class) ready which is written in VC++6. But presently i need to inherit its classes into my new C#.net project.so if there is some better solution with u then please give me...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.