SitePoint Sponsor

User Tag List

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

    how to access this ...

    object(SimpleXMLElement)#14 (1) { [0]=> string(40) "http://ext.ibood.com/offer_200_nl_nl.jpg" }
    its come from an object $node (lets say).
    $node[0] doesnt change anything.
    $node->0 is an error obviously.

    I want where var_dump($node) would give me string(40) "http://ext.ibood.com/offer_200_nl_nl.jpg"
    Khuram Javaid
    PHP Developer and Entrepreneur
    http://www.phprad.com/

  2. #2
    SitePoint Evangelist
    Join Date
    Jun 2006
    Location
    Wigan, Lancashire. UK
    Posts
    523
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    try
    PHP Code:
    foreach($node as $element) {
       echo 
    $element;

    ---
    Development Projects:
    PHPExcel
    PHPPowerPoint

  3. #3
    SitePoint Member robbin.joe's Avatar
    Join Date
    Oct 2009
    Location
    Beijing, China
    Posts
    22
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Mark Baker View Post
    try
    PHP Code:
    foreach($node as $element) {
       echo 
    $element;

    but it is a object.

    try this
    Code:
    $a =  (array)$object;
    echo $a[0];

  4. #4
    SitePoint Addict khuramyz's Avatar
    Join Date
    Oct 2005
    Location
    Manchester, UK
    Posts
    296
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you, I 'll try this and let you know.
    Khuram Javaid
    PHP Developer and Entrepreneur
    http://www.phprad.com/

  5. #5
    SitePoint Addict khuramyz's Avatar
    Join Date
    Oct 2005
    Location
    Manchester, UK
    Posts
    296
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    @robbin.joe
    Thank you for the solution. it works perfectly.
    Khuram Javaid
    PHP Developer and Entrepreneur
    http://www.phprad.com/


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
  •