Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New Coder
    Join Date
    Jun 2007
    Location
    UK
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    finding a character inside a string ?

    :) Problem solved...

    Rep added..
    Last edited by mutasim; 06-06-2007 at 07:04 AM.

  • #2
    Senior Coder
    Join Date
    Jan 2007
    Posts
    1,648
    Thanks
    1
    Thanked 58 Times in 54 Posts
    PHP Code:
    if (strstr($url'?') !== false) {
       
    // url contains the question mark
    } else {
       
    // url does not contain the question mark


  • #3
    New Coder
    Join Date
    Jun 2007
    Location
    UK
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks aedrin

    Just removing code... for privacy reasons
    Last edited by mutasim; 06-06-2007 at 07:05 AM.

  • #4
    Senior Coder
    Join Date
    Jan 2007
    Posts
    1,648
    Thanks
    1
    Thanked 58 Times in 54 Posts
    PHP Code:
    $aff_link2 =$aff_link1."&sid=".$userid

  • #5
    New Coder
    Join Date
    Jun 2007
    Location
    UK
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    oops

    Thanks again...
    Last edited by mutasim; 06-06-2007 at 07:05 AM.

  • #6
    Senior Coder
    Join Date
    Jan 2007
    Posts
    1,648
    Thanks
    1
    Thanked 58 Times in 54 Posts
    PHP Code:
    $aff_link1 "http://www.affiliateurlhere.com/index.php?ab=23";
    if (
    strstr($add_link1'?') !== false) { 
    $aff_link1 and $add_link1, typo?

    Also, use strpos instead of strstr. I forgot that it is more efficient when you only need to know if it exists or not.


  •  

    Posting Permissions

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