Table of contents Home page
$s = "\t\0Hello world!"; // This string starts with various whitespace characters echo '**', ltrim($s), "**\n"; // Printed without leading whitespace
$s = '--??Hello world!'; echo ltrim($s, '-?'), "\n"; // Printed without leading hyphens and question marks $s = 'afyfzu893470Hello world!'; echo ltrim($s ,'a..z0..9'), "\n"; // Printed without leading lower case letters and digits // Note that the list of characters that should be trimmed (i.e. the second argument) can only contain single-byte // characters!