http://site.ru/video/1-title/
Как убрать все после 1?
http://site.ru/video/1-title/
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]
<?php
$url = explode('/',rtrim($_GET['url'],'/'));
print_r($url);
?>
Array ( [0] => hellow [1] => my [2] => name [3] => is [4] => boris )
<?php
$url = explode('/',rtrim($_GET['url'],'/'));
print_r($url);
echo preg_replace("/\D/","", $url[2]);
?>
Array ( [0] => hellow [1] => my [2] => 123name [3] => is [4] => boris ) 123
<?php
$url = explode('/',rtrim($_GET['url'],'/'));
$filter = preg_replace("/\D/","", $url);
print_r($filter);
?>
Array ( [0] => [1] => [2] => 123 [3] => [4] => )