SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    illegal ********* immigrant
    Join Date
    Jul 2005
    Posts
    199
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    eregi quick question

    Hey there,

    Here is what I am trying to acheive:

    <font face="verdana,sans-serif" size=1 color=#000000>*retreive info here*</a></td>
    I have a string that contains the source code of a webpage.
    I want to retreive the information in bold below in all occurances inside the source and store each info retreived in a key, in an array.

    I am not sure if I should use the eregi() function or something else...

    Please help me on this one

    Thank you!

  2. #2
    SitePoint Guru aamonkey's Avatar
    Join Date
    Sep 2004
    Location
    kansas
    Posts
    953
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    PHP Code:
      $str '**contents of page here**';
      
      
    preg_match_all('#<font face="verdana,sans-serif" size=1 color=\#000000>(.*?)</a></td>#is'$str$matches);
      
      
    //now matches are in $matches[1] array 

  3. #3
    illegal ********* immigrant
    Join Date
    Jul 2005
    Posts
    199
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    What about this one?

    Sorry to bump my old thread but I would need the regular expression for this line:

    <p><font face="*ANYTHINGHERE*" size="*ANYTHINGHERE*">*RETREIVE TEXT HERE*</font></p>

    Thanks your help!

  4. #4
    eschew sesquipedalians silver trophy sweatje's Avatar
    Join Date
    Jun 2003
    Location
    Iowa, USA
    Posts
    3,749
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    '~<font[^>]*>(.*?)</font>~ims'
    Jason Sweat ZCE - jsweat_php@yahoo.com
    Book: PHP Patterns
    Good Stuff: SimpleTest PHPUnit FireFox ADOdb YUI
    Detestable (adjective): software that isn't testable.

  5. #5
    illegal ********* immigrant
    Join Date
    Jul 2005
    Posts
    199
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Wow thx sweatje what is the inside of the font contains other tags and I just want to keep the text?

    here is an example:
    <p><font face="Arial" size="4">Don't wait on <b>anyone</b>, ever!</font></p>

    I would need to retreive : Don't wait on anyone, ever! (without the tags)
    Is it possible to ask you guys help again? =)

    Thank you!

  6. #6
    eschew sesquipedalians silver trophy sweatje's Avatar
    Join Date
    Jun 2003
    Location
    Iowa, USA
    Posts
    3,749
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Have you looked at strip_tags()?
    Jason Sweat ZCE - jsweat_php@yahoo.com
    Book: PHP Patterns
    Good Stuff: SimpleTest PHPUnit FireFox ADOdb YUI
    Detestable (adjective): software that isn't testable.

  7. #7
    illegal ********* immigrant
    Join Date
    Jul 2005
    Posts
    199
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Great thank you sweatje you are a god!


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
  •