Page 1 of 4 123 ... LastLast
Results 1 to 10 of 32
Like Tree6Likes

Thread: Php oop!

  1. #1
    Senior Member
    Join Date
    Jan 2011
    Posts
    114
    Thanks
    9
    Thanked 2 Times in 2 Posts
    Rep Power
    3

    Default Php oop!

    can any one give a firm details about whats the difference between normal php and php oop!! what is extra in object oriented programming!! please let me know. I came here as i googled this and not getting the whole thing.

  2. #2
    Senior Member just_m3.'s Avatar
    Join Date
    Feb 2010
    Location
    Romania
    Posts
    173
    Thanks
    11
    Thanked 72 Times in 27 Posts
    Rep Power
    4

    Default

    Quote Originally Posted by asifnayem [Only registered and activated users can see links. Click Here To Register...]
    can any one give a firm details about whats the difference between normal php and php oop!! what is extra in object oriented programming!! please let me know. I came here as i googled this and not getting the whole thing.
    Here an simple description of what php oop can' do .. i can't tell you more because i'm still learning on that :D

    So . php oop its gonna make your codding very,very light and easy to manage .. because an php oop class can be used on manny scripts on different tasks is adaptable so for example to make an ease off ussage you could use it verry simple such as

    PHP Code:
    <?php 

    $myoop
    = new oopclass();
    $myoop->task('commands here','and something else');

     
    ?>
    While you gonna still learning you gonna think that its more like some' simple functions defined , but believe me that its more than just a simple function because an' oop class can use lot of functions defined in his content , as you can see in the upper example $myoop->task is a called function so you can execute a whole script just with 3 - 4 lines as simple as that :p

    So go for OOP ...

    [Only registered and activated users can see links. Click Here To Register...]

    here is a beginner tutorial for you enjoy reading it !


    Cheers !
    This is ten percent luck, twenty percent skill
    Fifteen percent concentrated power of will
    Five percent pleasure, fifty percent pain

    And a hundred percent reason to remember the name!

  3. #3
    Senior Member
    Join Date
    Jul 2008
    Posts
    364
    Thanks
    124
    Thanked 32 Times in 31 Posts
    Rep Power
    0

    Default

    For large applications, PHP OOP is good but for small applications PHP OOP is bad
    khan likes this.
    tinyurl.com/earnbymobile
    Easy earning for Indians
    ---------------------
    Alternative mobile advertising network .. Minimum 100 USD pay / NET15 pay cycle, Good Brand, Best targeting for Android
    goo.gl/6vub3

  4. #4
    Senior Member shushant's Avatar
    Join Date
    Feb 2011
    Location
    Root
    Posts
    197
    Thanks
    39
    Thanked 36 Times in 20 Posts
    Rep Power
    3

    Default

    Any1 of u Can Tell me
    that is dis right way to access functions in class
    Code:
    class mycls {
    public function me(){
    return "Hi";
    }
    public function hehe(){
    echo $this->me();
    }
    }
    or this
    Code:
    class mycls {
    public function me(){
    return "Hi";
    }
    public function hehe(){
    echo me();
    }
    }
    nd what is use of $this

  5. #5
    Senior Member softwarefreak's Avatar
    Join Date
    Jun 2011
    Location
    http://softwarefreak.in
    Posts
    347
    Thanks
    142
    Thanked 211 Times in 69 Posts
    Rep Power
    2

    Default

    1st one is correct

    $this represents the object inside the class
    PHP Code:
    class mycls {
    public 
    $name;
    public function 
    me()
    {
    return 
    "Hi";
    }
    public function 
    hehe()
    {
    //inside the class
    echo $this->me(); 
    }
    }
    $object = new mycls;
    echo 
    $object->me();
    //look at the above code, you had to create an instance of the class but inside the class you can use $this :P :D 
    StunningNick likes this.
    I need some facebook likes, can you please help me
    [Only registered and activated users can see links. Click Here To Register...]
    I noticed social media is really powerful
    Well DONE is better than well SAID

  6. The Following User Says Thank You to softwarefreak For This Useful Post:

    shushant (14-03-12)

  7. #6
    Senior Member shushant's Avatar
    Join Date
    Feb 2011
    Location
    Root
    Posts
    197
    Thanks
    39
    Thanked 36 Times in 20 Posts
    Rep Power
    3

    Default

    Quote Originally Posted by softwarefreak [Only registered and activated users can see links. Click Here To Register...]
    1st one is correct

    $this represents the object inside the class
    PHP Code:
    class mycls {
    public 
    $name;
    public function 
    me()
    {
    return 
    "Hi";
    }
    public function 
    hehe()
    {
    //inside the class
    echo $this->me(); 
    }
    }
    $object = new mycls;
    echo 
    $object->me();
    //look at the above code, you had to create an instance of the class but inside the class you can use $this :P :D 
    :P i know had to create an instance make it wrk

  8. #7
    Senior Member softwarefreak's Avatar
    Join Date
    Jun 2011
    Location
    http://softwarefreak.in
    Posts
    347
    Thanks
    142
    Thanked 211 Times in 69 Posts
    Rep Power
    2

    Default

    Quote Originally Posted by shushant [Only registered and activated users can see links. Click Here To Register...]
    :P i know had to create an instance make it wrk
    I know dat, you know but I tried to show the use of $this
    oreilly OOP e-book for a clear understanding, it's very helpful
    I need some facebook likes, can you please help me
    [Only registered and activated users can see links. Click Here To Register...]
    I noticed social media is really powerful
    Well DONE is better than well SAID

  9. #8
    Senior Member shushant's Avatar
    Join Date
    Feb 2011
    Location
    Root
    Posts
    197
    Thanks
    39
    Thanked 36 Times in 20 Posts
    Rep Power
    3

    Default

    Quote Originally Posted by softwarefreak [Only registered and activated users can see links. Click Here To Register...]
    I know dat, you know but I tried to show the use of $this
    oreilly OOP e-book for a clear understanding, it's very helpful
    Don't take me as wrng i was in need of help In OOP :p Having Problem understaning The use of $this and Some other Variables

  10. #9
    Senior Member CreativityKills's Avatar
    Join Date
    May 2009
    Location
    Lagos
    Posts
    844
    Thanks
    0
    Thanked 106 Times in 62 Posts
    Rep Power
    4

    Default

    OOP can be a force for both good and evil. Evil if you don't know what you're doing.

  11. #10
    Member StunningNick's Avatar
    Join Date
    Nov 2011
    Posts
    40
    Thanks
    6
    Thanked 49 Times in 7 Posts
    Rep Power
    0

    Exclamation $this

    Quote Originally Posted by softwarefreak [Only registered and activated users can see links. Click Here To Register...]
    1st one is correct

    $this represents the object inside the class
    PHP Code:
    class mycls {
    public 
    $name;
    public function 
    me()
    {
    return 
    "Hi";
    }
    public function 
    hehe()
    {
    //inside the class
    echo $this->me(); 
    }
    }
    $object = new mycls;
    echo 
    $object->me();
    //look at the above code, you had to create an instance of the class but inside the class you can use $this :P :D 


    i think "$this" represent non-static call , don't get me wrong, I'm an noob willing to learn :P

Page 1 of 4 123 ... LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

SEO by vBSEO

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19