[ create a new paste ] login | about

Link: http://codepad.org/OXvf4O6A    [ raw code | output | fork ]

PHP, pasted on Aug 13:
1
2
3
4
5
6
7
<?php
$haystack="/this/is/the/haystack/string/to/be/trimmed/using/a/needle/string/";
$needle="to/be/";
$result = explode($needle, $haystack);
$first_part = $result[0];
echo $first_part;
?>


Output:
1
/this/is/the/haystack/string/


Create a new paste based on this one


Comments: