<?php $metin = "http://localhost/sayfa.php?id=17"; preg_match("@id=([0-9]+)@i",$metin,$cikti); echo $cikti['1']; ?>