<?php $string = ' I would like to know '; var_export( preg_replace('/\s*(\S*(?:\s+\S+){0,9}).*/', '$1', $string) );
You have javascript disabled. You will not be able to edit any code.