Current location: Hot Scripts Forums » Programming Languages » PHP » array like vB


array like vB

Reply
  #1 (permalink)  
Old 04-16-07, 04:33 AM
zodehala zodehala is offline
Wannabe Coder
 
Join Date: Mar 2007
Posts: 191
Thanks: 0
Thanked 0 Times in 0 Posts
array like vB

i can not understand what a strcuture ?
PHP Code:

$vbulletin->db->query_first(""); 

how can i make like above ? would you give me a simple tutorial like it ?
Reply With Quote
  #2 (permalink)  
Old 04-16-07, 04:41 AM
UnrealEd's Avatar
UnrealEd UnrealEd is offline
Community Liaison
 
Join Date: May 2005
Location: Antwerp, Belgium
Posts: 3,165
Thanks: 4
Thanked 25 Times in 25 Posts
this structure is used to call methods and fields from a certain class.
in this case there's an object (in the variable $vbulletin) or a certain class. That class has a field named 'db', which is an object itself. The db object has method query_first. So now you're calling the method query_first of the db object that is a field of the $vbulletin object

here's a small example:
PHP Code:

class Foo{
  public 
$bar;
  
  public function 
__construct(){
    
$this->bar = new Bar;
  }
}

class 
Bar{
  public function 
bark(){
    echo 
"woof! woof!";
  }
}

$my_object = new Foo// instantiates a new object of the Foo class
$my_object->bar->bark(); // will output "woof! woof!" 
Hope this makes it a little clearer, if not, let me know

UnrealEd
__________________
"Good judgement comes from experience, and experience comes from bad judgement." - Fred Brooks

Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ')' Dr. Forensics PHP 3 07-15-06 03:54 PM
Sorting a massive multidimensional array dave111 PHP 1 12-12-05 04:09 PM
Serializing a set of arrays dannyallen PHP 2 10-11-04 03:04 AM
linking to iframe not working :( j0d JavaScript 5 01-19-04 08:14 PM
Using C DLL in VB. Function has argument with pointer to array stmoong Visual Basic 0 12-26-03 02:21 AM


All times are GMT -5. The time now is 06:01 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.