triming quates from the string? how

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
alexus
Forum Contributor
Posts: 159
Joined: Fri Jul 04, 2003 10:49 pm

triming quates from the string? how

Post by alexus »

hey
I tried all posible ways to trim quotation marls from the string (" and ') but it didnt workout!
Can someone help me?

Code: Select all

$test = trim($test,"/x22");
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

Rooster242
Forum Newbie
Posts: 18
Joined: Thu Aug 31, 2006 6:23 pm

Post by Rooster242 »

how bout:
$test = str_replace( '\"', '', $test );
alexus
Forum Contributor
Posts: 159
Joined: Fri Jul 04, 2003 10:49 pm

Post by alexus »

$test = str_replace( '\"', '', $test );

Doesnt work :-(
alexus
Forum Contributor
Posts: 159
Joined: Fri Jul 04, 2003 10:49 pm

Post by alexus »

aaaaaa.... help my brain is blowing .... can read more manual nothing is working
'-(
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Post by Benjamin »

Code: Select all

$test = str_replace( '"', '', $test );
alexus
Forum Contributor
Posts: 159
Joined: Fri Jul 04, 2003 10:49 pm

Post by alexus »

lol that was so simple :-)
I didnt try that one for str_replace and it works yay THANKS a lot! :D
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

If you read the manual on str_replace() (as I mentioned in my initial response to your original post) you would have seen the examples used match what astions showed. Did you read the manual?
alexus
Forum Contributor
Posts: 159
Joined: Fri Jul 04, 2003 10:49 pm

Post by alexus »

yep I did the used chr(022) as the charakter in the charakter array
Post Reply