[ create a new paste ] login | about

Link: http://codepad.org/6XwqvwuP    [ raw code | output | fork | 1 comment ]

PHP, pasted on May 10:
1
2
3
4
5
6
7
8
<?PHP

    $str = "Lorem ipsum dolor sit amet. Source: LOREM";
    $words = explode( " ", $str );
    array_splice( $words, -2 );

    // Lorem ipsum dolor sit amet.
    echo implode( " ", $words );


Output:
1
Lorem ipsum dolor sit amet.


Create a new paste based on this one


Comments:
posted by hasimam@gmail.com on Mar 12
hello my good man
reply