Let say we have set of URLs like this

```
yoursite.com/39827-key1-key2-key3
yoursite.com/132-key1-key2-key3
yoursite.com/9223455-key1-key2-key3

```

and so on
and let say with the help of .htaccess we can point all this urls to file say info.php
with the code 

```
<?=id?>

```

it should gives the following ids (with respect to each url)

```
39827-key1-key2-key3
132-key1-key2-key3
9223455-key1-key2-key3

```

My question now is there any way that we only get the number before first (-)
let say

```
$id = 39827-key1-key2-key3

```

we need to make it

```
$realid = 39827

```

so i wonder if there any preg\_replace or any any idea that can remove first (-) and all after it. 

example

```
For $id = 39827-key1-key2-key3
$realid = (something),$id
Then finally $realid = 39827

```

it will helps me to create easy understandable url and retrieve its data from database.

Thanks you and sorry for poor english.