Results 1 to 3 of 3

Thread: strpos

  1. #1

    Thread Starter
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256

    strpos

    I have this code, but it seems to crap out and not work correctly.

    PHP Code:
    <?php

        $mtext 
    "What's CSS?";
        
    $menu "<t|1|Intro to CSS> | <t|2|What's CSS?> | <t|3|CSS Chart>";

        echo 
    "<html><body>";
        
        if (
    strpos($menu"<t|") == false) {
            
    //it says this = false?
            
    echo "bah!";
        } else {
            do {
                
    $j strpos($menu"<");
                if (
    $j == false) {
                    break;
                }
                    
    $k strpos($menu">"$j);
                    
    $line substr($menu$j 3, ($k 1));
                    echo 
    $line "<br>";
                } while (
    $j != false);
            }
            return 
    $text;

    ?>
    any ideas?
    My evil laugh has a squeak in it.

    kristopherwilson.com

  2. #2
    PowerPoster
    Join Date
    Jul 1999
    Posts
    5,923
    maybe this is your problem
    PHP Code:
    // in PHP 4.0b3 and newer:
    $pos strpos($mystring"b");
    if (
    $pos === false) { // note: three equal signs
        // not found...

    from http://www.php.net/manual/en/function.strpos.php

  3. #3

    Thread Starter
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256
    Always something so simple.

    Thanks, Chris.
    My evil laugh has a squeak in it.

    kristopherwilson.com

Posting Permissions

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



Click Here to Expand Forum to Full Width