2 Replies Latest reply: Jun 16, 2014 9:52 AM by jyeager11 RSS

    Modifying this short PHP script [...] explode();

    jyeager11 Community Member

      $titlestart = "<title>";

      $titlestop = "</title>";

       

      $parsedtitle1 = explode($titlestart, $content);

      $parsedtitle2 = explode($titlestop, $parsedtitle1[1]);

      $content = $parsedtitle1[0] . $titlestart . "This is the new title" . $titlestop . $parsedtitle2[1];

       

      The above creates 2 markers and lets you substitute the content between them.

       

      But how would I modify it so that the markers are INCLUDED in the text being substituted?