SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Thread: strpos failure

  1. #1
    Serial Publisher silver trophy aspen's Avatar
    Join Date
    Aug 1999
    Location
    East Lansing, MI USA
    Posts
    12,937
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    any reason why this

    $pos = strpos($content, "<p align=\"center\"><big>");

    wouldn't work when the string contains

    <p align="center"><big>

    It just stopped working - I dont get it. It was working, then it stopped.

    I'm staring at it and staring at it and I dont see it.
    Chris Beasley - I publish content and ecommerce sites.
    Featured Article: Free Comprehensive SEO Guide
    My Guide to Building a Successful Website
    My Blog|My Webmaster Forums

  2. #2
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This prints 57 for me so I know its working, is $content getting unset or changed before running strpos?

    PHP Code:
    $content 'adfroui eh oiefoiehfiohdfh kjsdfgjksd fhgdfgisdhg dksfhg <p align="center"><big>Hellow Sinclair Hw are we today</big></p>';
    $pos strpos($content'<p align="center"><big>'); 
    print 
    $pos
    Please don't PM me with questions.
    Use the forums, that is what they are here for.

  3. #3
    Serial Publisher silver trophy aspen's Avatar
    Join Date
    Aug 1999
    Location
    East Lansing, MI USA
    Posts
    12,937
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    actually I figured it out - was a typo in the url that its parsing.

    the problem was that the new url looked very very similar to the correct one so I didn't really notice it until I looked closer.
    Chris Beasley - I publish content and ecommerce sites.
    Featured Article: Free Comprehensive SEO Guide
    My Guide to Building a Successful Website
    My Blog|My Webmaster Forums

  4. #4
    SitePoint Wizard
    Join Date
    Mar 2001
    Posts
    3,537
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    x
    Last edited by 7stud; Apr 17, 2001 at 10:22.

  5. #5
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    7stud
    ,

    as long as

    <p align="center"><big>

    is present in both strings then it is the same. I was asking him to make sure that the content of his string didn't get changed before running strpos().

    Ah.. well he figured it out anyways
    Please don't PM me with questions.
    Use the forums, that is what they are here for.


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
  •