- substr: documentation ( source)
<?php
$str = 'http://visitbeyond.areadigital.org/var/site/storage/images/media/images/china/beijing-urban-outskirts-5d/1.-steep-great-wall/196692-1-eng-GB/1.-steep-great-wall_gallery_large.jpg';
echo substr($str, 0, 30);