26282 total geeks with 3498 solutions
Recent challengers:
 Welcome, you are an anonymous user! [register] [login] Get a yourname@osix.net email address 

Articles

GEEK

User's box
Username:
Password:

Forgot password?
New account

Shoutbox
MaxMouse
It's Friday... That's good enough for me!
CodeX
non stop lolz here but thats soon to end thanks to uni, surely the rest of the world is going good?
stabat
how things are going guys? Here... boring...
CodeX
I must be going wrong on the password lengths then, as long as it was done on ECB
MaxMouse
lol... the key is in hex (MD5: of the string "doit" without the "'s) and is in lower case. Maybe i should have submitted this as a challenge!

Donate
Donate and help us fund new challenges
Donate!
Due Date: May 31
May Goal: $40.00
Gross: $0.00
Net Balance: $0.00
Left to go: $40.00
Contributors


News Feeds
The Register
Space dogs and
Dragons: A brief
history of reentry
tech
Your hot
peer-on-peer code
wrestling could net
$800k from Samsung
Win a Nexus 7 with
reed.co.uk and The
Register
WTF is... LTE
Advanced?
"Lab-smashing"
Stuxnet HELPED
Iran"s nuke effort,
says brainiac
MYSTERY Nokia Lumia
with
gazillion-pixel
camera "spotted"
Machine learning
climbs atop Hadoop
New 4TB drive
spaffs half a telly
season into your
eyes AT ONCE
Buff American
beauties keen to
dominate Euro youth
in tech tussle
Indian "attacks"
Norwegian telco to
get at Pakistan,
China
Slashdot
German Researchers
Hit 40 Gbps On
Wireless Link
The Hunt For
LulzSec"s Missing
Sixth Member
Latvian Police Raid
Teacher"s Home for
Uploading $4.00
Textbook
EFF Resumes
Accepting Bitcoin
Donations After Two
Year Hiatus
Google Drops XMPP
Support
Motion To Delay
Sanctions Against
Prenda Lawyers
Denied
NSA Data Center the
Focus of Tax
Controversy
Viruses In Mucus
Protect From
Infection
Reporters
Threatened, Labeled
Hackers For Finding
Security Hole
Judges Debate
Patents and If New
Software Makes a
Computer a "New
Machine"
Article viewer

PHP slash stripper made easy



Written by:dimport
Published by:dimport
Published on:2003-06-21 07:19:46
Topic:PHP
Search OSI about PHP.More articles by dimport.
 viewed 6394 times send this article printer friendly

Digg this!
    Rate this article :
just a little thing i picked up about PHP the other day...a slash striper...i noticed my signature ended up having a slash in in where there shouldn't be one...

just add these lines in a bit before updating whatever text you want to strip of extra slashes where "message" is the text. it's that easy
$mess =$message;
$mess = stripslashes($mess);
$pattern = ".+@.+..+";

This article was originally written by rukh

Did you like this article? There are hundreds more.

Comments:
AcidIce
2004-03-29 13:28:08
theres also an addslashes() function,
mysql_escape_string() to escape strings to go in a mysql query and addcslashes; "Quote string with slashes in a C style" (look up addcslashes on php.net)
Anonymously add a comment: (or register here)
(registration is really fast and we send you no spam)
BB Code is enabled.
Captcha Number:


Blogs: (People who have posted blogs on this subject..)
elasolova
My PHP Projects on Sat 26th Sep 10am
I have been developing PHP applications for almost a year now. I have developed three projects. One is a simple trivia game. The other is a question-answer based community at http://www.javaist.com/quans . The last one is a programming challenge site just
countll
Blog entry for Thu 25th Oct 7am on Thu 25th Oct 7am
soo nu on this wicked world of NET. just decided to dive in today..hope friend aroun here can help

Test Yourself: (why not try testing your skill on this subject? Clicking the link will start the test.)
Test of experience (hopefully) by AcidIce

Things you're only likely to know if you've actually written a lot of PHP before :)


     
Your Ad Here
 
Copyright Open Source Institute, 2006