note 95436 added to function.trim

From: Date: Sun, 03 Jan 2010 15:19:20 +0000
Subject: note 95436 added to function.trim
Groups: php.notes 
Request: Send a blank email to php-notes+get-164562@lists.php.net to get a copy of this message
Noticed strange behavior when trimming a directory off a file name starting with the letter "o". <?php $filePath = 'blog/2010/oh-this-is-an-example'; $section = 'blog/2010'; echo ltrim($filePath, $section); ?> result: h-this-is-an-example Does anyone know what "/o" is and why this is stripped? Current fix: <?php $filePath = 'blog/2010/oh-this-is-an-example'; $filePath = str_replace('/o', '/O', $filePath); //FIX for filenames beginning with "o" $section = 'blog/2010'; echo ltrim($filePath, $section); ?> result: Oh-this-is-an-example ---- Server IP: 92.48.74.199 Probable Submitter: 195.12.228.114 ---- Manual Page -- http://www.php.net/manual/en/function.trim.php Edit -- https://master.php.net/note/edit/95436 Del: integrated -- https://master.php.net/note/delete/95436/integrated Del: useless -- https://master.php.net/note/delete/95436/useless Del: bad code -- https://master.php.net/note/delete/95436/bad+code Del: spam -- https://master.php.net/note/delete/95436/spam Del: non-english -- https://master.php.net/note/delete/95436/non-english Del: in docs -- https://master.php.net/note/delete/95436/in+docs Del: other reasons-- https://master.php.net/note/delete/95436 Reject -- https://master.php.net/note/reject/95436 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#164562) next »