• 10Nov

    If the title confuses you, don’t fret. My tutorial will explain it to you. Strings, as we know in compu-speak is text. Well, if you want to get part of the text but not all of it, you can use substring. Then if you want to find the position of some text to use in the substring function , you can use the function for that to find the matches for what you put in. However, if there is no match it will default to 0.
    You need flash to play this tutorial.
    This tutorial goes over the following goals:
    Parts of strings
    Positions in Strings
    String lengths once more
    You can find this tutorial video on youtube here.

    Here are the sources used in this tutorial:
    tut017.php
    <?php
    //PHP Tutorial 017
    
    $string = "We eat lots of bread and butter all day long with tacos!";
    $search = "bread";
    $pos = strpos($string, $search);
    
    $return = substr($string, $pos+strlen($search));
    
    echo $return;
    ?>

    Here are all the php functions used in this tutorial:

    Posted by Kloplop321 @ 7:48 pm

One Response

WP_Orange_Techno
  • federal grants Says:

    Thanks for some quality points there. I am kind of new to online , so I printed this off to put in my file, any better way to go about keeping track of it then printing?

Leave a Comment

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.