in reply to Need to create a pre and post string from a REQUEST_URI

Solved it a different way in case anybody is curious. It handles all 3 scenarios:

$pre = substr ( $ENV{'REQUEST_URI'}, 0, index ( $ENV{'REQUEST_URI'}, "slice=" ) + 6 );
$post = substr ( $ENV{'REQUEST_URI'}, index ( $ENV{'REQUEST_URI'}, "slice=" ) + 6 );
if ( index ( $post, "&" ) >= 0 ) { 
    $post = substr ( $post, index ( $post, "&" ) ); 
} else { 
    $post = "";
}

I was expecting a convuluted regex but this seems to do the trick.

Thanx everyone.

======================
Sean Shrum
http://www.shrum.net

  • Comment on Re: Need to create a pre and post string from a REQUEST_URI