Re: [PHP] str_replace around a character??

2011-07-13 Thread Shiplu Mokaddim
If you are looking for a one liner reg ex, it may take some time. This may lead wasting your development time. Better you do the following, 1. replace the string with tokens in address. 2. Split using comma. 3. Apply common email regex. 4. Replace tokens with actual strings. 5. Rebuild/join the

Re: [PHP] str_replace around a character??

2011-07-13 Thread Jay Ess
On 2011-07-13 10:36, Vitalii Demianets wrote: On Wednesday 13 July 2011 11:09:45 Jay Ess wrote: On 2011-07-13 09:54, Karl DeSaulniers wrote: $cc = "ema...@domain.com ,ema...@doamin.com,ema...@domain.com , ema...@domain.com, " $cc = trim($cc,","); $result = preg_replace('/(\s?)(,)(\s?)/i', ',',

Re: [PHP] str_replace around a character??

2011-07-13 Thread Vitalii Demianets
On Wednesday 13 July 2011 11:09:45 Jay Ess wrote: > On 2011-07-13 09:54, Karl DeSaulniers wrote: > > $cc = "ema...@domain.com ,ema...@doamin.com,ema...@domain.com , > > ema...@domain.com, " > > $cc = trim($cc,","); > $result = preg_replace('/(\s?)(,)(\s?)/i', ',', $cc); The solution is broken beca

Re: [PHP] str_replace around a character??

2011-07-13 Thread Jay Ess
On 2011-07-13 09:54, Karl DeSaulniers wrote: $cc = "ema...@domain.com ,ema...@doamin.com,ema...@domain.com , ema...@domain.com, " $cc = trim($cc,","); $result = preg_replace('/(\s?)(,)(\s?)/i', ',', $cc); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.p

[PHP] str_replace around a character??

2011-07-13 Thread Karl DeSaulniers
Hello All, I am needing some assistance. I am trying to add some Cc and Bcc to a mail script I have. On the form I have instructions for each to be separated by a comma + a space. In an all perfect world each user would do this perfectly. ...but since were working with something different,

Re: [PHP] str_replace

2011-04-25 Thread Nathan Rixham
Jim Lucas wrote: On 4/24/2011 8:44 AM, Ron Piggott wrote: I am trying to figure out a syntax that will replace each instance of % with a different letter chosen randomly from the string $puzzle_filler. $puzzle_filler is populated with the letters of the alphabet, roughly in the same ratio as the

Re: [PHP] str_replace

2011-04-25 Thread Jim Lucas
On 4/24/2011 8:44 AM, Ron Piggott wrote: > > I am trying to figure out a syntax that will replace each instance of % with a > different letter chosen randomly from the string $puzzle_filler. > $puzzle_filler > is populated with the letters of the alphabet, roughly in the same ratio as > they > a

Re: [PHP] str_replace

2011-04-24 Thread Richard Quadling
On 24 April 2011 16:44, Ron Piggott wrote: > > I am trying to figure out a syntax that will replace each instance of % with > a different letter chosen randomly from the string $puzzle_filler. > $puzzle_filler is populated with the letters of the alphabet, roughly in the > same ratio as they are u

Re: [PHP] str_replace

2011-04-24 Thread Stuart Dallas
On Sunday, 24 April 2011 at 16:44, Ron Piggott wrote: > I am trying to figure out a syntax that will replace each instance of % with > a different letter chosen randomly from the string $puzzle_filler. > $puzzle_filler is populated with the letters of the alphabet, roughly in the > same ratio a

Re: [PHP] str_replace

2011-04-24 Thread Adam Richardson
On Sun, Apr 24, 2011 at 11:44 AM, Ron Piggott < ron.pigg...@actsministries.org> wrote: > > I am trying to figure out a syntax that will replace each instance of % > with a different letter chosen randomly from the string $puzzle_filler. > $puzzle_filler is populated with the letters of the alphabe

Re: [PHP] str_replace

2011-04-24 Thread Daniel Brown
On Sun, Apr 24, 2011 at 12:33, Daniel Brown wrote: > >    I just mocked this up now, and only tested it twice.  It's not the > most elegant solution, and probably shouldn't be used in high-demand > situations, but it should at least serve to get you started. And since email wrecks code format

Re: [PHP] str_replace

2011-04-24 Thread Daniel Brown
On Sun, Apr 24, 2011 at 11:44, Ron Piggott wrote: > > I am trying to figure out a syntax that will replace each instance of % with > a different letter chosen randomly from the string $puzzle_filler. > $puzzle_filler is populated with the letters of the alphabet, roughly in the > same ratio as the

[PHP] str_replace

2011-04-24 Thread Ron Piggott
I am trying to figure out a syntax that will replace each instance of % with a different letter chosen randomly from the string $puzzle_filler. $puzzle_filler is populated with the letters of the alphabet, roughly in the same ratio as they are used. This syntax replaces each instance of % wi

Re: [PHP] str_replace help

2010-04-02 Thread Nilesh Govindarajan
On 04/02/10 18:58, David Stoltz wrote: Hi folks, In ASP, I would commonly replace string line feeds for HTML output like this: Var = replace(value,vbcrlf,"") In PHP, the following doesn't seem to work: $var = str_replace(chr(13),"\n",$value) Neither does: $var = str_replace(chr(10),"\n",$valu

Re: [PHP] str_replace help

2010-04-02 Thread Midhun Girish
well david actually $var = str_replace(chr(13),"\n",$value) will replace char(13) with \n... but \n wont come up in html unless u give a tag.. u need to put $var = str_replace(chr(13),"",$value) in order to got the required output Midhun Girish On Fri, Apr 2, 2010 at 7:03 PM, Ashley Sheri

Re: [PHP] str_replace help

2010-04-02 Thread Ashley Sheridan
On Fri, 2010-04-02 at 09:28 -0400, David Stoltz wrote: > Hi folks, > > In ASP, I would commonly replace string line feeds for HTML output like > this: > > Var = replace(value,vbcrlf,"") > > In PHP, the following doesn't seem to work: > $var = str_replace(chr(13),"\n",$value) > > Neither do

[PHP] str_replace help

2010-04-02 Thread David Stoltz
Hi folks, In ASP, I would commonly replace string line feeds for HTML output like this: Var = replace(value,vbcrlf,"") In PHP, the following doesn't seem to work: $var = str_replace(chr(13),"\n",$value) Neither does: $var = str_replace(chr(10),"\n",$value) What am I doing wrong? Thanks!

Re: [PHP] str_replace

2009-08-08 Thread Ron Piggott
Yes I did. Thank you for confirming this with me. Ron - Original Message - From: "LinuxManMikeC" To: "Ron Piggott" Cc: ; Sent: Saturday, August 08, 2009 6:19 AM Subject: Re: [PHP] str_replace On Sat, Aug 8, 2009 at 2:08 AM, Ron Piggott wrote: Am I under

Re: [PHP] str_replace

2009-08-08 Thread LinuxManMikeC
On Sat, Aug 8, 2009 at 2:08 AM, Ron Piggott wrote: > Am I understanding str_replace correctly?  Do I have this correct or are ' > needed? > > $bible_verse_ref is what I want to change to (AKA replace) > bible_verse_ref is what I change to change from (AKA search) > $text_message_template is the st

[PHP] str_replace

2009-08-08 Thread Ron Piggott
Am I understanding str_replace correctly? Do I have this correct or are ' needed? $bible_verse_ref is what I want to change to (AKA replace) bible_verse_ref is what I change to change from (AKA search) $text_message_template is the string I want to manipulate $text_message = str_replace( $bible

RE: [PHP] str_replace oddity

2007-09-23 Thread Peter Lauri
0 AM > To: Jim Lucas > Cc: Kevin Waterson; php-general@lists.php.net > Subject: Re: [PHP] str_replace oddity > > So replace ' \" ' instead of ' " '. > > On 9/22/07, Jim Lucas <[EMAIL PROTECTED]> wrote: > > Kevin Waterson wrote: > >

Re: [PHP] str_replace oddity

2007-09-22 Thread heavyccasey
So replace ' \" ' instead of ' " '. On 9/22/07, Jim Lucas <[EMAIL PROTECTED]> wrote: > Kevin Waterson wrote: > > I am using str_replace to strip double quotes. > > > > $string = 'This string has "quotes" in it'; > > > > $string = str_replace('"', '', $string); > > > > this seems to work, yet when

Re: [PHP] str_replace oddity

2007-09-22 Thread Jim Lucas
Kevin Waterson wrote: I am using str_replace to strip double quotes. $string = 'This string has "quotes" in it'; $string = str_replace('"', '', $string); this seems to work, yet when I put the $string into mysql, it uses backslashes to escape where the quotes were. The double-quotes are gone,

[PHP] str_replace oddity

2007-09-21 Thread Kevin Waterson
I am using str_replace to strip double quotes. $string = 'This string has "quotes" in it'; $string = str_replace('"', '', $string); this seems to work, yet when I put the $string into mysql, it uses backslashes to escape where the quotes were. The double-quotes are gone, yet it still escapes the

Re: [PHP] str_replace new line

2007-07-02 Thread Richard Lynch
On Sat, June 30, 2007 12:04 pm, jekillen wrote: > Hello; > I have the following code: > > $prps = str_replace("\n", ' ', $input[3]); > $request = str_replace("// var purpose = {} ;\n", "var purpose = > '$prps';\n", $request); > > In the first line $input[3] is a string formatted with new lines a

Re: [PHP] str_replace new line

2007-07-02 Thread Jim Lucas
jekillen wrote: On Jul 2, 2007, at 6:07 PM, jekillen wrote: On Jul 2, 2007, at 3:15 PM, Greg Donald wrote: On 6/30/07, jekillen <[EMAIL PROTECTED]> wrote: Hello; I have the following code: $prps = str_replace("\n", ' ', $input[3]); Are you sure $input[3] doesn't have two newlines at th

Re: [PHP] str_replace new line

2007-07-02 Thread jekillen
On Jul 2, 2007, at 6:07 PM, jekillen wrote: On Jul 2, 2007, at 3:15 PM, Greg Donald wrote: On 6/30/07, jekillen <[EMAIL PROTECTED]> wrote: Hello; I have the following code: $prps = str_replace("\n", ' ', $input[3]); Are you sure $input[3] doesn't have two newlines at the end? Why not u

Re: [PHP] str_replace new line

2007-07-02 Thread Greg Donald
On 6/30/07, jekillen <[EMAIL PROTECTED]> wrote: Hello; I have the following code: $prps = str_replace("\n", ' ', $input[3]); Are you sure $input[3] doesn't have two newlines at the end? Why not use trim() to be sure? $request = str_replace("// var purpose = {} ;\n", "var purpose = '$prps

[PHP] str_replace new line

2007-06-30 Thread jekillen
Hello; I have the following code: $prps = str_replace("\n", ' ', $input[3]); $request = str_replace("// var purpose = {} ;\n", "var purpose = '$prps';\n", $request); In the first line $input[3] is a string formatted with new lines at the end of each line. It is to be used to initialize a ja

Re: [PHP] str_replace on words with an array

2006-11-04 Thread Dotan Cohen
On 03/11/06, Richard Lynch <[EMAIL PROTECTED]> wrote: On Fri, November 3, 2006 5:30 am, Dotan Cohen wrote: > To all others who took part in this thread: I was unclear on another > point as well, the issue of sql-injection. As I'm removing the > symbols, signs, and other non-alpha characters from

Re: [PHP] str_replace on words with an array

2006-11-03 Thread Richard Lynch
On Fri, November 3, 2006 5:30 am, Dotan Cohen wrote: > To all others who took part in this thread: I was unclear on another > point as well, the issue of sql-injection. As I'm removing the > symbols, signs, and other non-alpha characters from the query, I > expect it to be sql-injection proof. As I

Re: [PHP] str_replace on words with an array

2006-11-03 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 2006-10-30 21:18:33 +: > Dotan Cohen wrote: > > $searchQuery=str_replace( "^".$noiseArray."$", " ", $searchQuery); > > Ok, this is what the compiler will see... > > $searchQuery=str_replace("^Array$", " ", $searchQuery); > > Yes, that's a literal Array in the string. Yo

Re: [PHP] str_replace on words with an array

2006-11-03 Thread Dotan Cohen
On 31/10/06, Larry Garfield <[EMAIL PROTECTED]> wrote: From your original message, it sounds like you want to strip selected complete words, not substrings, from a string for indexing or searching or such. Right? I think that was my mistake- not differentiating between the two. Symbols and such

Re: [PHP] str_replace on words with an array

2006-10-30 Thread Ed Lazor
On Oct 30, 2006, at 1:10 PM, Dotan Cohen wrote: On 30/10/06, Stut <[EMAIL PROTECTED]> wrote: Ed Lazor wrote: > It looks like you guys are coming up with some cool solutions, but I > have a question. Wasn't the original purpose of this thread to > prevent sql injection attacks in input from

Re: [PHP] str_replace on words with an array

2006-10-30 Thread Larry Garfield
On Monday 30 October 2006 15:10, Dotan Cohen wrote: > Er, so how would it be done? I've been trying for two days now with no > success. From your original message, it sounds like you want to strip selected complete words, not substrings, from a string for indexing or searching or such. Right?

Re: [PHP] str_replace on words with an array

2006-10-30 Thread Ed Lazor
On Oct 30, 2006, at 9:19 AM, Stut wrote: Ed Lazor wrote: It looks like you guys are coming up with some cool solutions, but I have a question. Wasn't the original purpose of this thread to prevent sql injection attacks in input from user forms? If so, wouldn't mysql_real_escape_string b

Re: [PHP] str_replace on words with an array

2006-10-30 Thread Stut
Dotan Cohen wrote: > Er, so how would it be done? I've been trying for two days now with no > success. Ok, I guess my original reply didn't get through, or you ignored it. Here it is again for your convenience. Dotan Cohen wrote: > > $searchQuery=str_replace( "^".$noiseArray."$", " ", $searchQuer

Re: [PHP] str_replace on words with an array

2006-10-30 Thread Dotan Cohen
On 30/10/06, Stut <[EMAIL PROTECTED]> wrote: Ed Lazor wrote: > It looks like you guys are coming up with some cool solutions, but I > have a question. Wasn't the original purpose of this thread to > prevent sql injection attacks in input from user forms? If so, > wouldn't mysql_real_escape_stri

Re: [PHP] str_replace on words with an array

2006-10-30 Thread Stut
Ed Lazor wrote: It looks like you guys are coming up with some cool solutions, but I have a question. Wasn't the original purpose of this thread to prevent sql injection attacks in input from user forms? If so, wouldn't mysql_real_escape_string be an easier solution? Me thinkie nottie. From

Re: [PHP] str_replace on words with an array

2006-10-30 Thread Ed Lazor
It looks like you guys are coming up with some cool solutions, but I have a question. Wasn't the original purpose of this thread to prevent sql injection attacks in input from user forms? If so, wouldn't mysql_real_escape_string be an easier solution? On Oct 30, 2006, at 8:17 AM, Jochem

Re: [PHP] str_replace on words with an array

2006-10-30 Thread Jochem Maas
Dotan Cohen wrote: > I need to remove the noise words from a search string. I can't seem to > get str_replace to go through the array and remove the words, and I'd > rather avoid a redundant foreach it I can. According to TFM > str_replace should automatically go through the whole array, no? Does >

Re: [PHP] str_replace on words with an array

2006-10-30 Thread Jochem Maas
Dotan Cohen wrote: > I need to remove the noise words from a search string. I can't seem to > get str_replace to go through the array and remove the words, and I'd > rather avoid a redundant foreach it I can. According to TFM > str_replace should automatically go through the whole array, no? Does >

Re: [PHP] str_replace on words with an array

2006-10-29 Thread Ed Lazor
checkout the function mysql_real_escape_string() On Oct 29, 2006, at 3:13 PM, Dotan Cohen wrote: On 30/10/06, Paul Novitski <[EMAIL PROTECTED]> wrote: Hi Dotan, To get help with your problem, share more of your PHP code with the list so we can look at what you're doing. Also, give us a link

Re: [PHP] str_replace on words with an array

2006-10-29 Thread Dotan Cohen
On 30/10/06, Paul Novitski <[EMAIL PROTECTED]> wrote: Hi Dotan, To get help with your problem, share more of your PHP code with the list so we can look at what you're doing. Also, give us a link to the PHP script on your server so we can see the output. Regards, Paul Nothing else is relevan

Re: [PHP] str_replace on words with an array

2006-10-29 Thread Stut
Dotan Cohen wrote: > Thanks all for the heads up with the str_replace not working with > regexes. Duh! I've switched to preg_replace, but still no luck. (nor > skill, on my part) > > I'm trying to use array_walk to go through the array and deliminate > each item with /b so that the preg_replace fu

Re: [PHP] str_replace on words with an array

2006-10-29 Thread Dotan Cohen
Thanks all for the heads up with the str_replace not working with regexes. Duh! I've switched to preg_replace, but still no luck. (nor skill, on my part) I'm trying to use array_walk to go through the array and deliminate each item with /b so that the preg_replace function will know to only opera

Re: [PHP] str_replace on words with an array

2006-10-29 Thread Paul Novitski
Paul Novitski wrote: If you go this route, perhaps you could enclose each member of your original array in \b word boundary sequences using an array_walk routine so that you don't have to muddy your original array declaration statement. At 10/29/2006 01:54 PM, rich gray wrote: IIRC str_repl

Re: [PHP] str_replace on words with an array

2006-10-29 Thread Dotan Cohen
On 29/10/06, Børge Holen <[EMAIL PROTECTED]> wrote: Yes you need to put some \ in front of some of those characters On Sunday 29 October 2006 21:05, Dotan Cohen wrote: > I need to remove the noise words from a search string. I can't seem to > get str_replace to go through the array and remove th

Re: [PHP] str_replace on words with an array

2006-10-29 Thread Stut
Dotan Cohen wrote: > $searchQuery=str_replace( "^".$noiseArray."$", " ", $searchQuery); Ok, this is what the compiler will see... $searchQuery=str_replace("^Array$", " ", $searchQuery); Yes, that's a literal Array in the string. You cannot, and you should remember this, you cannot concatenate st

Re: [PHP] str_replace on words with an array

2006-10-29 Thread rich gray
Paul Novitski wrote: If you go this route, perhaps you could enclose each member of your original array in \b word boundary sequences using an array_walk routine so that you don't have to muddy your original array declaration statement. IIRC str_replace() does not interpret or understand re

Re: [PHP] str_replace on words with an array

2006-10-29 Thread Myron Turner
I never use this function, since I always use regular expressions, but according to the manual: If you don't need fancy replacing rules (like regular expressions), you should always use this function instead of ereg_replace() or preg_replace(). So, I assume your problem

Re: [PHP] str_replace on words with an array

2006-10-29 Thread Paul Novitski
At 10/29/2006 01:07 PM, Dotan Cohen wrote: The purpose of the ^ and the $ is to define the beginning and the end of a word: http://il2.php.net/regex No, actually, ^ and $ define the beginnning & end of the entire expression being searched, not the boundaries of a single word. Therefore sea

Re: [PHP] str_replace on words with an array

2006-10-29 Thread Dotan Cohen
On 29/10/06, Alan Milnes <[EMAIL PROTECTED]> wrote: Dotan Cohen wrote: > $searchQuery=str_replace( "^".$noiseArray."$", " ", $searchQuery); Can you explain what you are trying to do with the ^ and $? What is a typical value of the original $searchQuery? Alan The purpose of the ^ and the $ is

Re: [PHP] str_replace on words with an array

2006-10-29 Thread Børge Holen
Yes you need to put some \ in front of some of those characters On Sunday 29 October 2006 21:05, Dotan Cohen wrote: > I need to remove the noise words from a search string. I can't seem to > get str_replace to go through the array and remove the words, and I'd > rather avoid a redundant foreach it

[PHP] str_replace on words with an array

2006-10-29 Thread Dotan Cohen
I need to remove the noise words from a search string. I can't seem to get str_replace to go through the array and remove the words, and I'd rather avoid a redundant foreach it I can. According to TFM str_replace should automatically go through the whole array, no? Does anybody see anything wrong

Re: [PHP] str_replace(), and correctly positioned HTML tags

2006-05-26 Thread Jochem Maas
with regard to clean HTML - check out the tidy extension - it can do wonders with crufty output. http://php.net/tidy tedd wrote: At 12:26 PM +0900 5/26/06, Dave M G wrote: Tedd, Adam, Thank you for your advice. While I'm very grateful for your advice, unfortunately, it seems that the core o

Re: [PHP] str_replace(), and correctly positioned HTML tags

2006-05-26 Thread tedd
At 12:26 PM +0900 5/26/06, Dave M G wrote: Tedd, Adam, Thank you for your advice. While I'm very grateful for your advice, unfortunately, it seems that the core of what you suggest do not fit my situation. First, with Adam's suggestion that I use instead of . The output I am generating is

Re: [PHP] str_replace(), and correctly positioned HTML tags

2006-05-26 Thread Jochem Maas
Dave M G wrote: PHP list, ... take a look at: http://textism.com/ especially the 'textism' stuff which if nothing else mgiht give you some good ideas about plain text markup for conversion to HTML. -- Dave M G -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http

Re: [PHP] str_replace(), and correctly positioned HTML tags

2006-05-25 Thread Dave M G
Tedd, Adam, Thank you for your advice. While I'm very grateful for your advice, unfortunately, it seems that the core of what you suggest do not fit my situation. First, with Adam's suggestion that I use instead of . The output I am generating is akin to what csszengarden.com generates, so

Re: [PHP] str_replace(), and correctly positioned HTML tags

2006-05-25 Thread tedd
At 12:53 AM +0900 5/26/06, Dave M G wrote: PHP list, This may be a simple matter. Please feel free to tell me to RTFM if you can direct me to exactly where in the FM to R. Or, alternately, please use simple explanations, as I'm not an experienced PHP coder. I'm building a simple content mana

[PHP] str_replace(), and correctly positioned HTML tags

2006-05-25 Thread Dave M G
PHP list, This may be a simple matter. Please feel free to tell me to RTFM if you can direct me to exactly where in the FM to R. Or, alternately, please use simple explanations, as I'm not an experienced PHP coder. I'm building a simple content management system, where users can enter text i

Re: [PHP] str_replace ? \r

2006-02-07 Thread Curt Zirzow
On Tue, Feb 07, 2006 at 03:43:38PM -0800, Curt Zirzow wrote: > On Tue, Feb 07, 2006 at 10:38:37AM -0800, Sam Smith wrote: > > // output to html, removing xxs ablity and add html br's I mean XSS (Cross Site Scripting) Curt. -- cat .signature: No such file or directory -- PHP General Mailing Li

Re: [PHP] str_replace ? \r

2006-02-07 Thread Matty Sarro
Agreed - try to think of it as a filter and less of something that needs to be computed both ways... much easier in the long run, and more efficient :) On 2/7/06, Curt Zirzow <[EMAIL PROTECTED]> wrote: > > On Tue, Feb 07, 2006 at 10:38:37AM -0800, Sam Smith wrote: > > > > From a on a web form I'm

Re: [PHP] str_replace ? \r

2006-02-07 Thread Curt Zirzow
On Tue, Feb 07, 2006 at 10:38:37AM -0800, Sam Smith wrote: > > From a on a web form I'm attempting to convert all returns(\r), > from the users input, to "", for db INSERT, and then back again for > display in the . (They remain as s for normal HTML web page > display.) You really shouldnt conve

Re: [PHP] str_replace ? \r

2006-02-07 Thread Jay Paulson
http://us3.php.net/manual/en/function.nl2br.php Instead of using I would use tags. That's just me though. :) On 2/7/06 12:38 PM, "Sam Smith" <[EMAIL PROTECTED]> wrote: > > From a on a web form I'm attempting to convert all returns(\r), > from the users input, to "", for db INSERT, and then

[PHP] str_replace ? \r

2006-02-07 Thread Sam Smith
>From a on a web form I'm attempting to convert all returns(\r), from the users input, to "", for db INSERT, and then back again for display in the . (They remain as s for normal HTML web page display.) code: // From textarea to db UPDATE function addBR($tv) { $tv = addslashes($tv); $tv

Re: [PHP] str_replace

2005-10-10 Thread Jochem Maas
Charles Stuart wrote: A student run server on my old campus used to turn off PHP for security reasons - ridiculous. Would it be possible to use XSS to call curl from a remote site? I'm just a beginner so that may or not make sense. I'm not really a beginner but I don't know if that makes s

Re: [PHP] str_replace

2005-10-10 Thread Charles Stuart
A student run server on my old campus used to turn off PHP for security reasons - ridiculous. Would it be possible to use XSS to call curl from a remote site? I'm just a beginner so that may or not make sense. Indeed it does seem like JS is the solution - unfortunately - as it seems like

Re: [PHP] str_replace

2005-10-10 Thread Rory Browne
I'm not completely sure, but I think they're talking shite. If curl is a security problem, then disable curl. They seem from what you've said, to be pretty irrational. I respect security paranoia, but this is ridicules. You could try replacing every letter in the word curl with it's &#xxx; equivle

[PHP] str_replace

2005-10-10 Thread Charles Stuart
Hi, I'm on shared hosting. Because of security concerns on their part [1], every time the text "curl u" is inputted, a 403 forbidden is given and the form is not submitted. This is of course a problem as I'm doing work for a children's literacy program, and plenty of people try to input "

Re: [PHP] str_replace weird output

2005-06-02 Thread Andy Pieters
On Thursday 02 June 2005 09:52, [EMAIL PROTECTED] wrote: > But if I do that : > > $texte = 'cd' ; > $original = array('a', 'b', 'c', 'd', 'e', 'f', 'g'); > $modif = array ('c', 'd', 'e', 'f', 'g', 'h', 'i'); > $texte = str_replace($original, $modif, $texte) ; > echo $texte, ' ' ; > ?> > > The resu

[PHP] str_replace weird output

2005-06-02 Thread Johan . Barbier
Hello guys :-) I have a question. I have been using str_replace() quite a lot of times, and never encountered any issue. But this time, something weird happened, and I am wondering wether, in fact, I have never really understood how this function worked, or if there is some kind of bug. If I d

Re: [PHP] str_replace on words?

2005-05-12 Thread James E Hicks III
Merlin wrote: Hi there, I am trying to strip some words from a sentence. I tried it with str_replace like described here: http://www.totallyphp.co.uk/code/find_and_replace_words_in_a_text_string_using_str_replace.htm Unfortunatelly it does not work the way I want, because if I want to replace t

Re: [PHP] str_replace on words?

2005-05-12 Thread Merlin
Duncan Hill wrote: On Wednesday 11 May 2005 17:13, Merlin wrote: Hi there, I am trying to strip some words from a sentence. I tried it with str_replace like described here: http://www.totallyphp.co.uk/code/find_and_replace_words_in_a_text_string_us ing_str_replace.htm Unfortunatelly it does not wor

Re: [PHP] str_replace on words?

2005-05-11 Thread AC
I whipped this together, it should work ok. You'll want to clean it up, but you get the gist. $str="I'm going to the store to buy some stuff."; $bold=array("store","some","stuff"); function boldWord($str,$bold) { if(isset($str)) { foreach($bold as $b) { echo "$b should be $b\n";

Re: [PHP] str_replace on words?

2005-05-11 Thread tg-php
As mentioned in the "making words bold" thread, works aren't always separated by spaces. Sometimes they end a sentence so are followed by a period or other punctuation. Sometimes you have strings like "and/or" where they're separated by the forward slash, etc. You really have to do some kind

Re: [PHP] str_replace on words?

2005-05-11 Thread Brent Baisley
I think that's a bad example you read. It doesn't describe how to search on a "word" it describes how to search on a string, which is what you ended up doing. For things like this I use arrays. Assuming your "words" are separated by spaces, you can get an array of all the words by doing: $wor

RE: [PHP] str_replace on words?

2005-05-11 Thread Mikey
> Hi there, > > I am trying to strip some words from a sentence. I tried it > with str_replace like described here: > http://www.totallyphp.co.uk/code/find_and_replace_words_in_a_t > ext_string_using_str_replace.htm > > Unfortunatelly it does not work the way I want, because if I > want to repl

Re: [PHP] str_replace on words?

2005-05-11 Thread Duncan Hill
On Wednesday 11 May 2005 17:13, Merlin wrote: > Hi there, > > I am trying to strip some words from a sentence. I tried it with > str_replace like described here: > http://www.totallyphp.co.uk/code/find_and_replace_words_in_a_text_string_us >ing_str_replace.htm > > Unfortunatelly it does not work th

RE: [PHP] str_replace on words?

2005-05-11 Thread Jay Blanchard
[snip] Does anybody know how to do this on just words? [/snip] explode the string into an array of words and then apply the function to the array value. Then implode the string into a new string. http://www.php.net/explode http://www.php.net/implode -- PHP General Mailing List (http://www.php.ne

[PHP] str_replace on words?

2005-05-11 Thread Merlin
Hi there, I am trying to strip some words from a sentence. I tried it with str_replace like described here: http://www.totallyphp.co.uk/code/find_and_replace_words_in_a_text_string_using_str_replace.htm Unfortunatelly it does not work the way I want, because if I want to replace the word "in" al

[PHP] Str_replace?

2005-04-07 Thread Ryan A
Hey, I am making a site primary for the Swedish audiance, Swedish alphabets are pretty much the same as our English ones except for three extras, which are: (lowercase) åäö (and uppercase) ÅÄÖ While using dreamweaver to format some of the pages I noticed that DW converts those letters to: å=å ö=

Re: [PHP] str_replace problem

2004-10-20 Thread Chris Ditty
Thanks all for the tips. Was able to get it working like I wanted. Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] str_replace problem

2004-10-20 Thread Philip Thompson
On Oct 20, 2004, at 1:02 AM, Chris Ditty wrote: Hi all. I'm trying to do a little code snippets page for a site I am working on. I figured it would be simple enough. I would do a str_replace and replace the various html codes with the ascii eqivulant. Unfortunately, it is not working as expecte

Re: [PHP] str_replace problem

2004-10-20 Thread Robin Vickery
On Wed, 20 Oct 2004 01:02:12 -0500, Chris Ditty <[EMAIL PROTECTED]> wrote: > Hi all. I'm trying to do a little code snippets page for a site I am > working on. I figured it would be simple enough. I would do a > str_replace and replace the various html codes with the ascii > eqivulant. Unfortun

Re: [PHP] str_replace problem

2004-10-20 Thread Silvio Porcellana
Chris Ditty wrote: Hi all. I'm trying to do a little code snippets page for a site I am working on. I figured it would be simple enough. I would do a str_replace and replace the various html codes with the ascii eqivulant. Unfortunately, it is not working as expected. Can anyone help with this

[PHP] str_replace problem

2004-10-19 Thread Chris Ditty
Hi all. I'm trying to do a little code snippets page for a site I am working on. I figured it would be simple enough. I would do a str_replace and replace the various html codes with the ascii eqivulant. Unfortunately, it is not working as expected. Can anyone help with this? This is what I a

[PHP] str_replace - is it case sensitive

2004-08-14 Thread Andrew W
Is the str_replace function case sensitive, I cant seem to find any answer on the PHP manual website or in my books. If it is, is there anyway to make it case insensitive so it can handle mIxEd CaSe woRdS in any combination? Thanks AW -- PHP General Mailing List (http://www.php.net/) To unsubsc

Re: [PHP] str_replace() problem in PHP5 - anyone else?

2004-08-04 Thread Justin Patrin
On Wed, 04 Aug 2004 08:14:55 -0700, Jon Bertsch <[EMAIL PROTECTED]> wrote: > > Hi all, > > I have found a problem using the str_replace() function in PHP5. Over this > past weekend we switched our production server to php5.0.0 running on > apache 1.3.31 on SUSE9.1. Our development environment is

Re: [PHP] str_replace() problem in PHP5 - anyone else?

2004-08-04 Thread Jon Bertsch
Jason, Thanks for looking. Very perplexing (to me at least). Jon Bertsch -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] str_replace() problem in PHP5 - anyone else?

2004-08-04 Thread Curt Zirzow
* Thus wrote Jon Bertsch: > ... > > $html_output_1 .= $html_string[0]; > > $output = str_replace("@@FISCAL_YEAR@@", $this_year, $html_output_1 ); > > (I call it three times to do the replacements in the string). > > ... > > On our development box this little application runs fine. In productio

Re: [PHP] str_replace() problem in PHP5 - anyone else?

2004-08-04 Thread Jason Davidson
My mistake on $this_year. Jon Bertsch <[EMAIL PROTECTED]> wrote: > > > Jason, > > This code is not using any OO the variable is $this_year not $this->year. > > Running it under php5 on my dev box the string replace function works and > replaces the text as expected. > > Jon Bertsch > >

Re: [PHP] str_replace() problem in PHP5 - anyone else?

2004-08-04 Thread Jon Bertsch
Jason, This code is not using any OO the variable is $this_year not $this->year. Running it under php5 on my dev box the string replace function works and replaces the text as expected. Jon Bertsch -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.

Re: [PHP] str_replace() problem in PHP5 - anyone else?

2004-08-04 Thread Jason Davidson
Yup, i understand not in php 5, there was some large OO changes in php 5, which is why i asked about $this->year. Ive been using php 5 for the last year, and havent had a problem with str_replace, and have used it a fair amount for loading email templates. So when you look at the source, the @@F

Re: [PHP] str_replace() problem in PHP5 - anyone else?

2004-08-04 Thread Jon Bertsch
Jason wrote: >is it possbile $this->year isnt what you expect? If I hard code the value it makes no difference and it works fine in php4.3.x and in dev just not on php5 with some load on the server. It was tested on the same server before moving to live production and it worked then as well.

Re: [PHP] str_replace() problem in PHP5 - anyone else?

2004-08-04 Thread Jason Davidson
is it possbile $this->year isnt what you expect? Jason Jon Bertsch <[EMAIL PROTECTED]> wrote: > > > Hi all, > > I have found a problem using the str_replace() function in PHP5. Over this > past weekend we switched our production server to php5.0.0 running on > apache 1.3.31 on SUSE9.1. Our

[PHP] str_replace() problem in PHP5 - anyone else?

2004-08-04 Thread Jon Bertsch
Hi all, I have found a problem using the str_replace() function in PHP5. Over this past weekend we switched our production server to php5.0.0 running on apache 1.3.31 on SUSE9.1. Our development environment is identical. I have an application that runs a series of str_replace calls to drop in so

Re: [PHP] str_replace: use multiple or array?

2004-07-30 Thread Curt Zirzow
* Thus wrote PHP Gen: > Hi, > I need to use a couple of str_replace's in one of my > programs and would like to know which is more resource > friendly: > > 1) having multiple str_replace one after another > > eg: > $text = str_replace("orange", "apple", "$text"); > $text = str_replace("black", "w

[PHP] str_replace: use multiple or array?

2004-07-30 Thread PHP Gen
Hi, I need to use a couple of str_replace's in one of my programs and would like to know which is more resource friendly: 1) having multiple str_replace one after another eg: $text = str_replace("orange", "apple", "$text"); $text = str_replace("black", "white", "$text"); $text = str_replace("girl

Re: [PHP] str_replace or regex

2004-03-18 Thread Firman Wandayandi
eregi_replace('(\$\$)([a-z].+)', '\1z', '$$a'); Maybe i'm wrong, please crosscheck. Regards, Firman - Original Message - From: "Adam Williams" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, March 19, 2004 1:06 AM Su

  1   2   >