<?php

$str = "abaaksjjkdhaf 29023487 - 1kfksdjf";

echo preg_replace('/[^\d-]/i', '', $str);