FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » str_replace does not like empty quotes
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: str_replace does not like empty quotes [message #186195 is a reply to message #186194] Fri, 20 June 2014 01:33 Go to previous messageGo to previous message
Jerry Stuckle is currently offline  Jerry Stuckle
Messages: 2598
Registered: September 2010
Karma:
Senior Member
On 6/19/2014 9:21 PM, Arno Welzel wrote:
> Arno Welzel, 2014-06-20 03:19:
>
>> richard, 2014-06-20 01:33:
>>
>>> $a=str_replace($a,"\","");
>>>
>>> This generates the error: Unexpected "".
>>>
>>> http://www.php.net//manual/en/function.str-replace.php
>>>
>>> While here in the manual, they do precisely the same thing!
>>
>> No - they don't!
>>
>> Use: $a=str_replace($a,"\"","");
>
> Sorry - of course: $a=str_replace("\"","",$a);
>
> Since the order of the parameters is
>
> 1) What to search
> 2) What to replace
> 3) Where to search in
>
>> Beware of the double quotes, since \ starts an escape - this means, the
>> meaning of the second quote (") is NOT "end string here".
>>
>> To make this more clear:
>>
>>
>> " <- String starts here. \" <- This just ONE character end here -> "
>
>

Arno, that will replace the double quotes ("), which doesn't look like
what Richard wants.

But why help him when all he does is insult the same people who try to
help him? That's exactly why I didn't just give him the answer in the
first place (not to mention the fact he's asked similar questions
before, and has still failed to learn).

--
==================
Remove the "x" from my email address
Jerry Stuckle
jstucklex(at)attglobal(dot)net
==================
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: PDO fetch with SQL server
Next Topic: Putting it all together
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sun Nov 24 00:12:12 GMT 2024

Total time taken to generate the page: 0.05039 seconds