[ create a new paste ] login | about

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

PHP, pasted on Dec 27:
1
2
3
4
5
6
7
<?php

$str = "This is the title-This is an example";

$title = substr($str, 0, strpos($str, '-'));

var_dump($title);


Output:
1
string(17) "This is the title"


Create a new paste based on this one


Comments: