Python-like string slicing in PHP