The ProgrammersTalk Community
Forum Register Search Today's Posts Mark Forums Read
Register

Go Back   The ProgrammersTalk Community > Web Programming > PHP


Welcome to the The ProgrammersTalk Community forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.
Reply
 
LinkBack Thread Tools    Display Modes   
  #11 (permalink)  
Old 06-30-2007, 07:25 AM
Lee's Avatar
Lee Lee is offline
PT Staff*
Awards Showcase
Quality Tutorial 
Total Awards: 1
Join Date: Jun 2007
Location: Blackpool, UK
Posts: 616
iTrader: (0)
Lee is just really niceLee is just really niceLee is just really niceLee is just really nice
I have no limit for this box so im happy with what i have now, i will keep that in mind though

__________________

Digg this Post! Del.Icio.Us this Post! Technorati this Post! Furl this Post! Mister Wong this Post! Newsvine this Post! Spurl this Post! Reddit this Post! Netscape this Post!
Reply With Quote
  #12 (permalink)  
Old 07-29-2007, 05:40 PM
molotov molotov is offline
Novice
Join Date: Jul 2007
Posts: 37
iTrader: (0)
molotov is on a distinguished road
I use this little bit all the time:

PHP Code:
$foo 'molotov';
$bar preg_replace("/[^a-zA-Z0-9_]/""_"$foo);
echo 
$bar// 'molotov'

$foo 'mo1otov';
$bar preg_replace("/[^a-zA-Z0-9_]/""_"$foo);
echo 
$bar// 'mo_otov'

$foo 'm@1oto\/';
 
$bar preg_replace("/[^a-zA-Z0-9_]/""_"$foo);
 echo 
$bar// 'm__oto__' 
The expression basically says, "replace anything that is NOT a lowercase letter, an uppercase letter, a digit, or an underscore, with an underscore."
It's great when I'm letting people upload files and they have spaces in the names of the files or other junk; 'My Birthday!!!!.jpg', etc.

__________________

Digg this Post! Del.Icio.Us this Post! Technorati this Post! Furl this Post! Mister Wong this Post! Newsvine this Post! Spurl this Post! Reddit this Post! Netscape this Post!
Reply With Quote
The Following 3 Users Say Thank You to molotov For This Useful Post:
HelloWorld (07-29-2007), Lee (07-30-2007), TeraTask (07-29-2007)
  #13 (permalink)  
Old 07-13-2008, 05:08 AM
t020 t020 is offline
Novice
Join Date: Jul 2008
Posts: 1
iTrader: (0)
t020 is on a distinguished road
siLenTz, i ve read ur tutorials and they were really helpful to me so thanks for that first, but I stille have a question to you:
I need to create a replace function that places every text from [ quote ] to [ /quote ] in a <div>, for example [ quote ]blahblah[ /quote ] should be replaced as <div>blahblah</div>
could you plz tell me how I can do that?
NOTE: the blank spaces between [ and quote should not be there, i placed them there cause else this forum transfers them to a quote message

__________________

Digg this Post! Del.Icio.Us this Post! Technorati this Post! Furl this Post! Mister Wong this Post! Newsvine this Post! Spurl this Post! Reddit this Post! Netscape this Post!

Last edited by t020 : 07-13-2008 at 05:11 AM.
Reply With Quote
Reply


Thread Tools
Display Modes

   Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -7. The time now is 02:59 PM. Powered by vBulletin
Copyright © 2000 - 2007, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO © 2007 ProgrammersTalk Sedo - Buy and Sell Domain Names and Websites project info: programmerstalk.net Statistics for project programmerstalk.net etracker® web controlling instead of log file analysis


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50