[ create a new paste ] login | about

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

PHP, pasted on Aug 28:
1
2
3
4
5
<?php

$url = 'phones/gift.nintendo-3ds/handset.blackberry-9790.html';

echo preg_replace('~^([^/]+)(/[^/]+)~', '$1', $url);


Output:
1
phones/handset.blackberry-9790.html


Create a new paste based on this one


Comments: