<?php

$regexp = '/[\0-]+/';
$str = preg_replace("/\D/", '-', $_GET[num]);
echo $str;

$nig= preg_split ($regexp, $str);
$nig1= $nig[1];
$nig2= $nig[2];
var_dump($nig);
echo $nig1;
echo $nig2;