1
In PHP we can split one string and turn it into array.
Example:
$url = 'pagina/id/1';
explode('/', $url);
Upshot:
['', 'id', '1']
However, if this url had a bar before and after, it would return some empty values.
$url = '/pagina/id/1/';
explode('/', $url);
['', '', 'id', '1', '']
How could you make sure that these empty values are not returned (without having to use array_filter)?
another limiter can be used for preg instead of using
/as a limiter can be used#,@,~, getting~/~,#/#,@/@– Guilherme Lautert