Results 1 to 4 of 4

Thread: PHP Help...

  1. #1

    PHP Help...

    Ok, I've used the file_get_contents function to retrieve the contents of a page. Now, I need the php that will display multiple items from those contents... for example:
    Code:
    <tr><td class="cell_2"><span class="title">Rank</title></td>
        <td class="cell_2"><span class="title_big">
        Noob
        </span></td></tr>
    I need a php code that searches for "Rank", and then echoes "Noob", or the next 4 characters, or something that will echo whatever the rank would happen to be.

    Hope I'm making myself clear there... thanks.

  2. #2
    Join Date
    Jun 2004
    Location
    North of some border
    Posts
    5,589
    Moved to Programming.

    Lois
    Do you have a WHT question or concern? Please open a helpdesk ticket.

    "Do what you can, where you are, with what you have." Theodore Roosevelt

  3. #3
    You need to use regular expressions in your PHP code. Please refer to PHP manual at http://www.php.net/preg_match

  4. #4
    Join Date
    Jan 2005
    Location
    California
    Posts
    254
    PHP Code:
    $username $_SESSION["user"];
    $var mysql_query("SELECT `rank` FROM `db_table` WHERE `username` = '$username'");

    while (
    $var mysql_fetch_assoc($rank)) {
          echo 
    $rank["rank"];

    I believe should work? Of course you have to have $username which would be a session varaible which you would have to setup but you get the gist of it.

Posting Permissions

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