note 92475 added to function.substr

From: Date: Sun, 26 Jul 2009 10:44:41 +0000
Subject: note 92475 added to function.substr
Groups: php.notes 
Request: Send a blank email to php-notes+get-158734@lists.php.net to get a copy of this message
Shortens the filename and its expansion has seen. $file = "Hellothisfilehasmorethan30charactersandthisfayl.exe"; function funclongwords($file) { if (strlen($file) > 30) { $vartypesf = strrchr($file,"."); $vartypesf_len = strlen($vartypesf); $word_l_w = substr($file,0,15); $word_r_w = substr($file,-15); $word_r_a = substr($word_r_w,0,-$vartypesf_len); return $word_l_w."...".$word_r_a.$vartypesf; } else return $file; } // RETURN: Hellothisfileha...andthisfayl.exe // other simples on rollyz.net ---- Server IP: 78.41.104.8 Probable Submitter: 91.124.234.159 ---- Manual Page -- http://www.php.net/manual/en/function.substr.php Edit -- https://master.php.net/note/edit/92475 Del: integrated -- https://master.php.net/note/delete/92475/integrated Del: useless -- https://master.php.net/note/delete/92475/useless Del: bad code -- https://master.php.net/note/delete/92475/bad+code Del: spam -- https://master.php.net/note/delete/92475/spam Del: non-english -- https://master.php.net/note/delete/92475/non-english Del: in docs -- https://master.php.net/note/delete/92475/in+docs Del: other reasons-- https://master.php.net/note/delete/92475 Reject -- https://master.php.net/note/reject/92475 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#158734) next »