<?php $str = "# 12 # # # Hello World"; $arr = explode(" ", $str); $arr = array_slice($arr, 0,5); $new = implode(" ", $arr); Echo $new;
You have javascript disabled. You will not be able to edit any code.