SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Addict khuramyz's Avatar
    Join Date
    Oct 2005
    Location
    Manchester, UK
    Posts
    296
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Reflection Problem

    Hello there,
    I am bit new to Reflection Process in PHP5.
    I have a scenario where I get a

    $obj = mysql_fetch_object($rs);

    Now, I want to take this object, get all its dynamic public member variables and applie stripslashes() to them.
    Can you tell me how I should getting about doing that.

    Much Thanks

  2. #2
    SitePoint Wizard stereofrog's Avatar
    Join Date
    Apr 2004
    Location
    germany
    Posts
    4,324
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You don't need reflection to achieve this. Foreach works fine for objects:
    PHP Code:
    foreach($object as &$member)
        
    $member  whatever
    And you don't need stripslashes here. There's no extra slashes stored in DB, you only need them when you add the data.


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
  •