www.webdeveloper.com
Results 1 to 6 of 6

Thread: Php Dom

  1. #1
    Join Date
    Aug 2007
    Location
    Apartment
    Posts
    175

    Php Dom

    Hey.

    Has anyone worked with the PHP DOM here? I'm trying to get data from files with .php extensions. It allows for xml, html, but I couldn't find anything for .php extensions.

    It's important to note that you are allowed to add html/xml text for the DOM classes in the form of a string. Though, I only know how to get data from asource file with PHP; how would you grab the file after all PHP parsing?

    Can someone help me out? What's the best way of going about this? Thanks.
    Bob Saget.

  2. #2
    Join Date
    Sep 2004
    Location
    At the corner of WALK and DONT WALK
    Posts
    1,728
    Um... I don't think there is any such thing as the PHP DOM. PHP is simply a programming language used to generate webpages.

  3. #3
    Join Date
    Apr 2003
    Location
    Netherlands
    Posts
    21,654
    I don't think the extension is of any importance as long as the document is valid xml.

    php: dom
    At least 98% of internet users' DNA is identical to that of chimpanzees

  4. #4
    Join Date
    Jul 2003
    Location
    The City of Roses
    Posts
    2,503
    bals28mjk, it doesn't matter what the extension is, as long as the file contents is actually XML. You would use the load method like you would for any other file.
    for(split(//,'))*))91:+9.*4:1A1+9,1))2*:..)))2*:31.-1)4131)1))2*:3)"'))
    {for(ord){$i+=$_&7;grep(vec($s,$i++,1)=1,1..($_>>3)-4);}}print"$s\n";

  5. #5
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    19,428
    Quote Originally Posted by Jeff Mott
    bals28mjk, it doesn't matter what the extension is, as long as the file contents is actually XML. You would use the load method like you would for any other file.
    However, if it is a file on the local file system, you would not want to load it via a file system path, as the PHP would not then be executed, so you would be trying to parse the PHP source and the the XML/HTML/XHTML that it outputs. You would need to access it via a URL even if it's on the same host.
    "Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
    ~ Terry Pratchett in Nation

    eBookworm.us

  6. #6
    Join Date
    Aug 2007
    Location
    Apartment
    Posts
    175
    Quote Originally Posted by NogDog
    However, if it is a file on the local file system, you would not want to load it via a file system path, as the PHP would not then be executed, so you would be trying to parse the PHP source and the the XML/HTML/XHTML that it outputs. You would need to access it via a URL even if it's on the same host.
    Yeah, that's the issue I was trying to get around, calling the file with a url instead works.

    Quote Originally Posted by Mr Initial Man
    Um... I don't think there is any such thing as the PHP DOM. PHP is simply a programming language used to generate webpages.
    Check this out Mr Initial Man, it might interest you: http://gtk.php.net/

    It's a language binding used to build stand alone apps with php. I'm working on a personal project right now that uses it.

    @all Thanks for sharing/helping.
    Bob Saget.

Thread Information

Users Browsing this Thread

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

Posting Permissions

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



Recent Articles