- explode: documentation ( source)
- preg_split: documentation ( source)
- json_encode: documentation ( source)
<?php
$x = 'http://www.youtube.com/user/';
echo json_encode(explode('/', $x));
echo json_encode(preg_split('/\//', $x, NULL, PREG_SPLIT_NO_EMPTY));