Freelancer.com

Go Back   Warrior Forum - The #1 Internet Marketing Forum & Marketplace > Warrior Support Forums > Programming
Register Blogs Social Groups CalendarHelp Desk

Reply
LinkBack Thread Tools
Unread 21st February 2013, 09:06 PM   #1
Advanced Warrior
War Room Member
 
BenQ's Avatar
 
Join Date: 2009
Posts: 806
Thanks: 83
Thanked 180 Times in 146 Posts
Default Can someone please help with this code snippet?

I'm using a script, and it's having a problem with some characters. There is a fix for it, but I can't quite figure it out.

The fix is to replace 3 instances of:
Code:
str_replace(" ","",$str);
with
Code:
preg_replace("/[^A-Za-z0-9]/","",$str);
To clarify, in each instance of replacing you need to make sure the $str is the same as the one replacing. The preg replace applies to the same $var as the str_replace.

However, the 3 instances where str_replace appear look like this:

Code:
str_replace(" ","",$value);
str_replace(" ","",$value1);
str_replace(" ","",$value);
So I'm unclear on exactly what I should change my lines to. Any help? If you could show me in detail it would be appreciated.
BenQ is offline   Reply With Quote
Unread 22nd February 2013, 07:45 AM   #2
Advanced Warrior
War Room Member
 
BenQ's Avatar
 
Join Date: 2009
Posts: 806
Thanks: 83
Thanked 180 Times in 146 Posts
Default Re: Can someone please help with this code snippet?

Figured it out, thanks anyway. Amazing what a few hours sleep will do to solve a problem.
BenQ is offline   Reply With Quote
Reply

  Warrior Forum - The #1 Internet Marketing Forum & Marketplace > Warrior Support Forums > Programming

Bookmarks

Tags
code, snippet

Thread Tools

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

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




All times are GMT -6. The time now is 03:04 PM.