| 
	
 | 
 Posted by d on 03/09/06 12:12 
Q" <dontbother@hotmail.com> wrote in message  
news:440ff112$0$11068$e4fe514c@news.xs4all.nl... 
> Hi, 
> 
> I want to make a 'plain' filename from a database entry.. 
> So eg: 
> 
> Test (for ^@@\example-etc.)%&#.html 
> ==> 
> Test_for_example-etc._.html 
> 
> Pleaaaaaaaase??? 
 
I use something like this: 
 
$s=preg_replace("/[^A-Z0-9_\-\.]+/i", "_", strtolower($s)); 
$s=preg_replace("/_{2,}/", "_", $s); 
 
which does what you want :) 
 
dave 
 
> :-))) 
> 
> Regards, 
>   Marco 
>
 
  
Navigation:
[Reply to this message] 
 |