Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 15
  1. #1
    Senior Member assassingod's Avatar
    Join Date
    Nov 2002
    Posts
    112
    Member #
    307
    Hey;

    Here's a request;

    Everytime I want to add a
    Code:
    <a href="">link</a>
    , I would like the number of links to be displayed as a numerical status.

    Would this be possible (Or do you understand :dead: )
    assassingod - vB.org Moderator :ichatsmile:

  2.  

  3. #2
    Senior Member filburt1's Avatar
    Join Date
    Jul 2002
    Location
    Maryland, US
    Posts
    11,774
    Member #
    3
    Liked
    21 times
    You'll need to use regular expressions. Not sure if this works but it should (just learned regexs recently):
    PHP Code:
    echo "number of links: " preg_match_all("'<a*.?</a>'"$variablewithsomehtml); 
    filburt1, Web Design Forums.net founder
    Site of the Month contest: submit your site or vote for the winner!

  4. #3
    Senior Member assassingod's Avatar
    Join Date
    Nov 2002
    Posts
    112
    Member #
    307
    Cool, I'll try that out later - Thanks!
    assassingod - vB.org Moderator :ichatsmile:

  5. #4
    Senior Member assassingod's Avatar
    Join Date
    Nov 2002
    Posts
    112
    Member #
    307
    Just tried it got this warning:
    Im looking into it now

    Warning: Wrong parameter count for preg_match_all() in c:\apache\htdocs\ff-dc\games.php on line 62
    assassingod - vB.org Moderator :ichatsmile:

  6. #5
    Senior Member filburt1's Avatar
    Join Date
    Jul 2002
    Location
    Maryland, US
    Posts
    11,774
    Member #
    3
    Liked
    21 times
    Add an extra argument, $trash, onto the end of the function call. Didn't realise it was required.
    filburt1, Web Design Forums.net founder
    Site of the Month contest: submit your site or vote for the winner!

  7. #6
    Senior Member assassingod's Avatar
    Join Date
    Nov 2002
    Posts
    112
    Member #
    307
    Thank you - Will do that now
    assassingod - vB.org Moderator :ichatsmile:

  8. #7
    Senior Member assassingod's Avatar
    Join Date
    Nov 2002
    Posts
    112
    Member #
    307
    Ok, thats got rid of the error, but it doesnt show the ammount of links, just 0
    assassingod - vB.org Moderator :ichatsmile:

  9. #8
    Senior Member filburt1's Avatar
    Join Date
    Jul 2002
    Location
    Maryland, US
    Posts
    11,774
    Member #
    3
    Liked
    21 times
    Try '<a(.*)?</a>'instead of '<a*.?</a>', or ''<a.*?</a>''
    filburt1, Web Design Forums.net founder
    Site of the Month contest: submit your site or vote for the winner!

  10. #9
    Senior Member assassingod's Avatar
    Join Date
    Nov 2002
    Posts
    112
    Member #
    307
    Cool - trying that now
    assassingod - vB.org Moderator :ichatsmile:

  11. #10
    Senior Member assassingod's Avatar
    Join Date
    Nov 2002
    Posts
    112
    Member #
    307
    Didnt work
    assassingod - vB.org Moderator :ichatsmile:


Page 1 of 2 1 2 LastLast

Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 10:46 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com