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:

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 because of: 1)

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 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

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 are

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

Re: [PHP] str_replace

2011-04-24 Thread Daniel Brown
On Sun, Apr 24, 2011 at 11:44, 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 alphabet, roughly

Re: [PHP] str_replace

2011-04-24 Thread Daniel Brown
On Sun, Apr 24, 2011 at 12:33, Daniel Brown danbr...@php.net 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

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 alphabet,

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 as

Re: [PHP] str_replace

2011-04-24 Thread Richard Quadling
On 24 April 2011 16:44, 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 alphabet, roughly in the

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,br) In PHP, the following doesn't seem to work: $var = str_replace(chr(13),\n,$value) Neither does: $var =

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 pre tag.. u need to put $var = str_replace(chr(13),br/,$value) in order to got the required output Midhun Girish On Fri, Apr 2, 2010 at 7:03 PM, Ashley

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,br) 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)

Re: [PHP] str_replace

2009-08-08 Thread LinuxManMikeC
On Sat, Aug 8, 2009 at 2:08 AM, Ron Piggottron@actsministries.org 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)

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 linuxmanmi...@gmail.com To: Ron Piggott ron@actsministries.org Cc: php-general@lists.php.net; phps...@gmail.com Sent: Saturday, August 08, 2009 6:19 AM Subject: Re: [PHP] str_replace

RE: [PHP] str_replace oddity

2007-09-23 Thread Peter Lauri
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: I am using str_replace to strip double quotes. $string = 'This string has quotes

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,

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 I put the $string

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';\n,

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 use

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 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 at the end

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 the

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-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. You cannot, and you

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-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-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,

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.

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_string be

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.$, , $searchQuery); Ok,

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

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 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-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 I

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 to

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

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

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: [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 strings and

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 the

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

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

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

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

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(), 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:

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 br / instead of p. The output I am

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

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

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 br / instead of p. The output I am generating is akin to what csszengarden.com

Re: [PHP] str_replace ? \r

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

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 textarea on a web form I'm attempting to convert all returns(\r), from the users input, to br /, for db INSERT, and then back again for display in the textarea. (They remain as br /s for normal HTML web page display.) You

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 textarea on a web form

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 List

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;

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 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

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 : ?php $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, ' br /' ; ? The

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

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

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

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 the way I

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 replace the

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:

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 of

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. ?php /* AC Was here */ $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

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

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.

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

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 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

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
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

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:

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 -- 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 production where

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 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: 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, white, $text); ...

Re: [PHP] str_replace or regex

2004-03-18 Thread Richard Davey
Hello Adam, Thursday, March 18, 2004, 6:06:06 PM, you wrote: AW Hi, I was wondering if I can get some help with either a str_replace or a AW regex. I have some data and it always begins with $$ but it can end with AW any letter of the alphabet. so sometimes its $$a and sometimes its $$b AW and

Re: [PHP] str_replace or regex

2004-03-18 Thread John W. Holmes
From: Adam Williams [EMAIL PROTECTED] Hi, I was wondering if I can get some help with either a str_replace or a regex. I have some data and it always begins with $$ but it can end with any letter of the alphabet. so sometimes its $$a and sometimes its $$b and sometimes $$c all the way to

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 Subject: [PHP] str_replace or regex Hi, I was wondering if I

Re: [PHP] str_replace problem

2004-03-17 Thread Jason Wong
On Wednesday 17 March 2004 20:16, Labunski wrote: The problem is that str_replace isn't working preperly: So *how* does it not work properly? -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications

Re: [PHP] str_replace to replace /n with p not having desired effect.

2004-02-19 Thread Adam Voigt
Single quotes don't work for the escape characters. Use double quotes around the str_replace where there is a \n. On Thu, 2004-02-19 at 10:52, Dave G wrote: PHP Listers, I am trying to use str_replace to format text taken from a MySQL TEXT field and make it so that it is compatible

Re: [PHP] str_replace to replace /n with p not having desired effect.

2004-02-19 Thread Richard Davey
Hello Dave, Thursday, February 19, 2004, 3:52:54 PM, you wrote: DG $charInfoCss = 'p class=content' . str_replace('\n', '/p\np class=content\n', $charInfo[introE]) . '/p'; Double-bag it: str_replace(\n, /p\np class=\content\\n, $charInfo[introE]) -- Best regards, Richard Davey

RE: [PHP] str_replace to replace /n with p not having desiredeffect. [SOLVED]

2004-02-19 Thread Dave G
From: Adam Single quotes don't work for the escape characters. Use double quotes around the str_replace where there is a \n. and... From: Richard Double-bag it: str_replace(\n, /p\np class=\content\\n, $charInfo[introE]) It's always the simplest of mistakes that one overlooks. Thanks guys!

Re: [PHP] str_replace not replacing

2004-02-11 Thread Richard Davey
Hello Aaron, Wednesday, February 11, 2004, 3:00:47 PM, you wrote: AM $section1 = file_get_contents(table_create.php); AM str_replace($search, $replace, $section1); You need to assign the output of str_replace to something: $new_section = str_replace($search, $replace, $section1) -- Best

Re: [PHP] str_replace not replacing

2004-02-11 Thread Jason Wong
On Wednesday 11 February 2004 23:00, Aaron Merrick wrote: My problem is, I want to replace the table name in the original file with a new table name before I output it to the new file. But the str_replace has no effect. [snip] str_replace($search, $replace, $section1); str_replace()

Re: [PHP] str_replace not replacing

2004-02-11 Thread Aaron Merrick
Richard, Thank you so much. That works perfectly. I knew it had to be something simple. Aaron From: Richard Davey [EMAIL PROTECTED] Reply-To: Richard Davey [EMAIL PROTECTED] Date: Wed, 11 Feb 2004 15:04:44 + To: Aaron Merrick [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Re: [PHP

Re: [PHP] Str_Replace Command

2004-02-02 Thread Jason Wong
On Tuesday 03 February 2004 00:14, Christopher J. Crane wrote: $StockURL = http://finance.yahoo.com/d/quotes.txt?s=xrx,ikn,dankyf=sl1e=.txt;; $StockResults = implode('', file($StockURL)); $Rows = split(\n, $StockResults); foreach($Rows as $Row) { echo str_replace('',,$Row).br\n; }

Re: [PHP] Str_Replace Command

2004-02-02 Thread Christopher J. Crane
Ok I got around it by the following, but now I have a new problem. I can not get the two dimensional array working. I want to later be able to output a variable like this $TickerData[IKN] and it will output the associated $Price. $StockURL =

Re: [PHP] Str_Replace Command

2004-02-02 Thread Jason Wong
On Tuesday 03 February 2004 00:52, Christopher J. Crane wrote: Ok I got around it by the following, but now I have a new problem. I can not get the two dimensional array working. I want to later be able to output a variable like this $TickerData[IKN] and it will output the associated $Price.

Re: [PHP] Str_Replace Command

2004-02-02 Thread Christopher J. Crane
Well this is it and it is really got me... Echoing out the $Symbol and $Price works just fine one row about the $TickerData array assignment. Yet it outputs nothing. Array ( [] = ) is what I get. If I change the line to $TickerData = array ($Symbol = $Price); I get nothing, or the same result. If

Re: [PHP] Str_Replace Command

2004-02-02 Thread Jason Wong
On Tuesday 03 February 2004 01:09, Christopher J. Crane wrote: Well this is it and it is really got me... Echoing out the $Symbol and $Price works just fine one row about the $TickerData array assignment. Yet it outputs nothing. Array ( [] = ) is what I get. If I change the line to

Re: [PHP] Str_Replace Command

2004-02-02 Thread Matt Matijevich
snip $StockURL = http://finance.yahoo.com/d/quotes.txt?s=xrx,ikn,dankyf=sl1e=.txt;; $StockResults = implode('', file($StockURL)); $Rows = split(\n, $StockResults); foreach($Rows as $Row) { list($Symbol, $Price) = split(,, $Row); $Symbol = str_replace('', , $Symbol); echo $Symbol.

RE: [PHP] Str_Replace Command

2004-02-02 Thread Crane, Christopher
- Infrastructure Services IKON Document Efficiency at Work -Original Message- From: Matt Matijevich [mailto:[EMAIL PROTECTED] Sent: Monday, February 02, 2004 12:25 PM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: [PHP] Str_Replace Command snip $StockURL = http://finance.yahoo.com/d

Re: [PHP] str_replace and TABS

2004-01-21 Thread Matt Matijevich
[snip] I'm using the following to replace certain characters but am having troubles with TABS. How do I find them? $replacement = array(\, ,, ., !, ?,;, :,),(,\n); Thanks [/snip] I think \t . Double check with google. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

  1   2   >