Re: [PHP] Stripping carriage returns

2011-01-11 Thread Jim Lucas
On 1/11/2011 11:13 AM, Richard S. Crawford wrote: > I'm retrieving CLOB data from an Oracle database, and cleaning up the HTML > in it. I'm using the following commands: > > $content = > strip_tags($description->fields['CONTENT'],''); > $content = preg_replace("//","",$content); > > The s

Re: [PHP] Stripping carriage returns

2011-01-11 Thread Mari Masuda
On Jan 11, 2011, at 11:34 AM, Richard S. Crawford wrote: > Strangely, when I use \n, or nl2br(), or PHP_EOL, or anything like that, it > strips out not just line breaks, but most of the rest of the text as well. I > suspect an encoding issue at this point. > > Daniel, you were right when you sai

Re: [PHP] Stripping carriage returns

2011-01-11 Thread Richard S. Crawford
Strangely, when I use \n, or nl2br(), or PHP_EOL, or anything like that, it strips out not just line breaks, but most of the rest of the text as well. I suspect an encoding issue at this point. Daniel, you were right when you said that neither of my str_replace lines had repl.acement values; that

Re: [PHP] Stripping carriage returns

2011-01-11 Thread David Harkness
On Tue, Jan 11, 2011 at 11:13 AM, Richard S. Crawford wrote: > $content = preg_replace("/[".chr(10)."|".chr(13)."]/","",$content) > This should be $content = preg_replace('/[\r\n]/','',$content) First, you can embed \r and \n directly in the regular expression as-is (not converted to chr(1

Re: [PHP] Stripping carriage returns

2011-01-11 Thread Daniel Brown
On Tue, Jan 11, 2011 at 14:13, Richard S. Crawford wrote: > > $content = str_replace(chr(13),$content) > > and > > $content = str_replace(array('\n','\r','\r\n'),$content) Neither of these have replacement values, which might just be a typo. However, the larger issue is in the single (litera

Re: [PHP] Stripping carriage returns

2011-01-11 Thread Ashley Sheridan
On Tue, 2011-01-11 at 11:13 -0800, Richard S. Crawford wrote: > I'm retrieving CLOB data from an Oracle database, and cleaning up the HTML > in it. I'm using the following commands: > > $content = > strip_tags($description->fields['CONTENT'],''); > $content = preg_replace("//","",$content

Re: [PHP] Stripping Characters

2010-06-23 Thread Richard Quadling
On 23 June 2010 01:03, Rick Dwyer wrote: > $find = '/[^a-z0-9]/i'; Replace that with ... $find = '/[^a-z0-9]++/i'; And now you only need ... $new_string = trim(preg_replace($find, $replace, $old_string)); -- - Richard Quadling "Standing on the shoulders of some very clever giants!" EE

Re: [PHP] Stripping Characters

2010-06-22 Thread Rick Dwyer
Very good. Thank you. --Rick On Jun 22, 2010, at 8:14 PM, Ashley Sheridan wrote: On Tue, 2010-06-22 at 20:03 -0400, Rick Dwyer wrote: Hello again list. My code for stripping characters is below. I'm hoping to get feedback as to how rock solid it will provide the desired output under a

Re: [PHP] Stripping Characters

2010-06-22 Thread Ashley Sheridan
On Tue, 2010-06-22 at 20:03 -0400, Rick Dwyer wrote: > Hello again list. > > My code for stripping characters is below. I'm hoping to get feedback > as to how rock solid it will provide the desired output under any > circumstance: > > My output must look like this (no quotes): > > "This-is

Re: [PHP] Stripping Characters

2010-06-22 Thread Rick Dwyer
Hello again list. My code for stripping characters is below. I'm hoping to get feedback as to how rock solid it will provide the desired output under any circumstance: My output must look like this (no quotes): "This-is-my-string-with-lots-of-junk-characters-in-it" The code with string l

Re: [PHP] Stripping Characters

2010-06-22 Thread Rick Dwyer
On Jun 22, 2010, at 1:41 PM, Ashley Sheridan wrote: It is clean, but as Richard mentioned, it won't handle strings outside of the traditional 128 ASCII range, so accented characters and the like will be converted to an underscore. Also, spaces might become an issue. However, if you are

Re: [PHP] Stripping Characters

2010-06-22 Thread Jim Lucas
Shreyas Agasthya wrote: > Then, when does one use ereg_replace as against preg_replace? I read from > one the forums that preg_* is faster and ereg_* is if not faster but > simpler. BUT, all the ereg_* has been depricated. DO NOT USE THEM if you want your code to work in the future. :) > > Is

Re: [PHP] Stripping Characters

2010-06-22 Thread Ashley Sheridan
On Tue, 2010-06-22 at 13:35 -0400, Rick Dwyer wrote: > Thanks to everyone who responded. > > Regarding the myriad of choices, isn't Ashley's, listed below, the one > most like to guarantee the cleanest output of just letters and numbers? > > > --Rick > > > On Jun 22, 2010, at 11:44 AM, As

Re: [PHP] Stripping Characters

2010-06-22 Thread Rick Dwyer
Thanks to everyone who responded. Regarding the myriad of choices, isn't Ashley's, listed below, the one most like to guarantee the cleanest output of just letters and numbers? --Rick On Jun 22, 2010, at 11:44 AM, Ashley Sheridan wrote: On Tue, 2010-06-22 at 11:40 -0400, Rick Dwyer wrot

Re: [PHP] Stripping Characters

2010-06-22 Thread Shreyas Agasthya
Then, when does one use ereg_replace as against preg_replace? I read from one the forums that preg_* is faster and ereg_* is if not faster but simpler. Is that it? Regards, Shreyas On Tue, Jun 22, 2010 at 9:58 PM, Richard Quadling wrote: > "A "word" character is any letter or digit or the und

Re: [PHP] Stripping Characters

2010-06-22 Thread Richard Quadling
"A "word" character is any letter or digit or the underscore character, that is, any character which can be part of a Perl "word". The definition of letters and digits is controlled by PCRE's character tables, and may vary if locale-specific matching is taking place. For example, in the "fr" (Frenc

Re: [PHP] Stripping Characters

2010-06-22 Thread Nathan Nobbe
On Tue, Jun 22, 2010 at 9:40 AM, Rick Dwyer wrote: > Hello List. > > I need to remove characters from a string and replace them with and > underscore. > > So instead of having something like: > > $moditem = str_replace("--","_","$mystring"); > $moditem = str_replace("?","_","$mystring"); > $modit

Re: [PHP] Stripping Characters

2010-06-22 Thread Richard Quadling
On 22 June 2010 16:44, Ashley Sheridan wrote: > On Tue, 2010-06-22 at 11:40 -0400, Rick Dwyer wrote: > >> Hello List. >> >> I need to remove characters from a string and replace them with and >> underscore. >> >> So instead of having something like: >> >> $moditem = str_replace("--","_","$mystring

Re: [PHP] Stripping Characters

2010-06-22 Thread Shreyas Agasthya
Perhaps, ereg_replace("your regex", "replacement_string", String $variable). Regards, Shreyas On Tue, Jun 22, 2010 at 9:10 PM, Rick Dwyer wrote: > Hello List. > > I need to remove characters from a string and replace them with and > underscore. > > So instead of having something like: > > $modi

Re: [PHP] Stripping Characters

2010-06-22 Thread Ashley Sheridan
On Tue, 2010-06-22 at 11:40 -0400, Rick Dwyer wrote: > Hello List. > > I need to remove characters from a string and replace them with and > underscore. > > So instead of having something like: > > $moditem = str_replace("--","_","$mystring"); > $moditem = str_replace("?","_","$mystring"); >

RE: [PHP] Stripping Characters

2010-06-22 Thread David Česal
Hello, can this resolve your problem? $trans = array( "from" => "to", "another" => "to"); $moditem = StrTr($moditem, $trans); -- http://cz.php.net/manual/en/function.strtr.php David -Original Message- From: Rick Dwyer [mailto:rpdw...@earthlink.net] Sent: Tuesday, June 22, 2010 5:41 PM

Re: [PHP] stripping first comma off and everything after

2010-06-19 Thread Al
On 6/19/2010 3:08 AM, Adam Richardson wrote: $before_needle = true Requires 5.3 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] stripping first comma off and everything after

2010-06-19 Thread Daniel P. Brown
On Sat, Jun 19, 2010 at 05:09, Ashley Sheridan wrote: > > A substring() a strpos() should do the trick: Echo echo [sprintf()] -- URGENT: EXTENDED TO SATURDAY, 19 JUNE: $100 OFF YOUR FIRST MONTH, FREE CPANEL FOR LIFE ON ANY NEW DEDICATED SERVER. NO LIMIT! daniel.br...@par

Re: [PHP] stripping first comma off and everything after

2010-06-19 Thread Ashley Sheridan
On Sat, 2010-06-19 at 10:09 +0100, Ashley Sheridan wrote: > On Fri, 2010-06-18 at 15:03 -0500, Adam wrote: > > > I'm querying data and have results such as a variable named > > $entries[$i]["dn"]: > > > > CN=NTPRTPS3-LANIER-LD335c-LH107-PPRNP9A92,OU=XXf,OU=XX,OU=X,DC

Re: [PHP] stripping first comma off and everything after

2010-06-19 Thread Ashley Sheridan
On Fri, 2010-06-18 at 15:03 -0500, Adam wrote: > I'm querying data and have results such as a variable named > $entries[$i]["dn"]: > > CN=NTPRTPS3-LANIER-LD335c-LH107-PPRNP9A92,OU=XXf,OU=XX,OU=X,DC=,DC=xx,DC=xxx > > > > Basically I need to strip of

Re: [PHP] stripping first comma off and everything after

2010-06-19 Thread Adam Richardson
On Sat, Jun 19, 2010 at 3:08 AM, Adam Richardson wrote: > On Fri, Jun 18, 2010 at 3:56 PM, Adam Williams < > adam_willi...@bellsouth.net> wrote: > >> I'm querying data and have results such as a variable named >> $entries[$i]["dn"]: >> >> CN=NTPRTPS3-LANIER-LD335c-LH107-PPRNP9A92,OU=XXf,OU

Re: [PHP] stripping first comma off and everything after

2010-06-19 Thread Adam Richardson
On Fri, Jun 18, 2010 at 3:56 PM, Adam Williams wrote: > I'm querying data and have results such as a variable named > $entries[$i]["dn"]: > > CN=NTPRTPS3-LANIER-LD335c-LH107-PPRNP9A92,OU=XXf,OU=XX,OU=X,DC=,DC=xx,DC=xxx > > > Basically I need to strip off

Re: [PHP] stripping first comma off and everything after

2010-06-18 Thread Daniel P. Brown
On Fri, Jun 18, 2010 at 15:56, Adam Williams wrote: > I'm querying data and have results such as a variable named > $entries[$i]["dn"]: > > CN=NTPRTPS3-LANIER-LD335c-LH107-PPRNP9A92,OU=XXf,OU=XX,OU=X,DC=,DC=xx,DC=xxx > > Basically I need to strip off the

Re: [PHP] stripping first comma off and everything after

2010-06-18 Thread Robert Cummings
Adam Williams wrote: I'm querying data and have results such as a variable named $entries[$i]["dn"]: CN=NTPRTPS3-LANIER-LD335c-LH107-PPRNP9A92,OU=XXf,OU=XX,OU=X,DC=,DC=xx,DC=xxx Basically I need to strip off the first command everything after, so

Re: [PHP] stripping with an OB callback [SOLVED]

2006-09-22 Thread Christopher Watson
Thanks for the follow-up Richard. I am now bracketing my Fusebox core includes with ob_start("ob_gzhandler") and ob_end_flush(). It's done wonders for those large query results. And since there is absolutely nothing in this app that relies on multiple contiguous whitespace characters, I'm good

Re: [PHP] stripping with an OB callback

2006-09-22 Thread Richard Lynch
Cannot compression be set in .htaccess? Or even within the script??? I suspect you could even find a PHP class out there to compress and send the right headers to do it all in PHP, regardless of server settings... On Wed, September 20, 2006 7:33 pm, Christopher Watson wrote: > Hi Robert, > > Wel

Re: [PHP] stripping with an OB callback

2006-09-22 Thread Richard Lynch
On Wed, September 20, 2006 7:13 pm, Christopher Watson wrote: > I've been coding with PHP for maybe a year. So I'm somewhat new to > it. But I've learned quickly, and created a fairly serious LAMP app > that is capable of returning large query results. During my > investigation into various mean

Re: [PHP] stripping with an OB callback

2006-09-20 Thread Christopher Watson
Bingo! That's the ticket. Thanks, Robert. -Christopher On 9/20/06, Robert Cummings <[EMAIL PROTECTED]> wrote: Why settle for 30% speed boost when you can get 90% ... http://ca3.php.net/manual/en/function.ob-gzhandler.php :) -- PHP General Mailing List (http://www.php.net/) To unsubscri

Re: [PHP] stripping with an OB callback

2006-09-20 Thread Robert Cummings
On Wed, 2006-09-20 at 17:33 -0700, Christopher Watson wrote: > Hi Robert, > > Well, I think the main reason I'm not using transparent output > compression is because this app shares php.ini with several other PHP > apps on the server, and I don't want to foist this change on the > admins of those

Re: [PHP] stripping with an OB callback

2006-09-20 Thread Christopher Watson
Hi Robert, Well, I think the main reason I'm not using transparent output compression is because this app shares php.ini with several other PHP apps on the server, and I don't want to foist this change on the admins of those apps. I was trying to come up with a localized strategy for trimming my

Re: [PHP] stripping with an OB callback

2006-09-20 Thread Robert Cummings
On Wed, 2006-09-20 at 20:21 -0400, Robert Cummings wrote: > On Wed, 2006-09-20 at 17:13 -0700, Christopher Watson wrote: > > I've been coding with PHP for maybe a year. So I'm somewhat new to > > it. But I've learned quickly, and created a fairly serious LAMP app > > that is capable of returning

Re: [PHP] stripping with an OB callback

2006-09-20 Thread Robert Cummings
On Wed, 2006-09-20 at 17:13 -0700, Christopher Watson wrote: > I've been coding with PHP for maybe a year. So I'm somewhat new to > it. But I've learned quickly, and created a fairly serious LAMP app > that is capable of returning large query results. During my > investigation into various means

Re: [PHP] stripping enclosed text from PHP code

2006-04-10 Thread Richard Lynch
Have you considered running php -s from the command line, which syntax highlights your source file for you, the searching for whatever color codes in your php.ini are used for functions? For that matter, you could custom-code the choices for the color and make the functions read in a separate php.

Re: [PHP] stripping enclosed text from PHP code

2006-04-10 Thread Robin Vickery
On 09/04/06, Winfried Meining <[EMAIL PROTECTED]> wrote: > > Hi, > > I am writing on a script that parses a PHP script and finds all function calls > to check, if these functions exist. To do this, I needed a function that would > strip out all text, which is enclosed in apostrophes or quotation ma

Re: [PHP] stripping enclosed text from PHP code

2006-04-09 Thread Satyam
http://www.phpcompiler.org/ Satyam - Original Message - From: "Winfried Meining" <[EMAIL PROTECTED]> To: Sent: Sunday, April 09, 2006 10:20 PM Subject: [PHP] stripping enclosed text from PHP code Hi, I am writing on a script that parses a PHP script and finds all function calls

Re: [PHP] Stripping control M character (^M)

2005-09-11 Thread Burhan Khalid
Philip Hallstrom wrote: Hello All, I'm having some issues with carriage returns. Specifically the control M character (^M). I have attempted to clean and validate the file I'm creating. Here's the code. while ($row = mysql_fetch_array($result)){ // assign and clean vars $artist = trim($r

Re: [PHP] Stripping control M character (^M)

2005-09-07 Thread Philip Hallstrom
Hello All, I'm having some issues with carriage returns. Specifically the control M character (^M). I have attempted to clean and validate the file I'm creating. Here's the code. while ($row = mysql_fetch_array($result)){ // assign and clean vars $artist = trim($row[artist]); $tdDate =

Re: [PHP] stripping html tags

2005-06-06 Thread Dotan Cohen
On 6/7/05, Richard Lynch <[EMAIL PROTECTED]> wrote: > > Your RegEx is probably fine... > > But you are probably missing a closing quote in lines BEFORE line 39, and > PHP thinks everything up the the =^ is still part of some giant > monster long string that spans multiple lines, and then it g

Re: [PHP] stripping html tags

2005-06-06 Thread Richard Lynch
Your RegEx is probably fine... But you are probably missing a closing quote in lines BEFORE line 39, and PHP thinks everything up the the =^ is still part of some giant monster long string that spans multiple lines, and then it gets to the /head bit (because your opening quote is really a cl

Re: [PHP] stripping html tags

2005-06-05 Thread Dotan Cohen
On 6/6/05, Richard Lynch <[EMAIL PROTECTED]> wrote: > On Sun, June 5, 2005 7:05 am, Dotan Cohen said: > > I took this example from php.net, but can't figure out where I went > > wrong. Why does this: > > $text = preg_replace("/(.|\s)*?<\/head>/i" , "" , $text); > > > > throw this error: > > syntax

Re: [PHP] stripping html tags

2005-06-05 Thread Richard Lynch
On Sun, June 5, 2005 7:05 am, Dotan Cohen said: > I took this example from php.net, but can't figure out where I went > wrong. Why does this: > $text = preg_replace("/(.|\s)*?<\/head>/i" , "" , $text); > > throw this error: > syntax error at line 265, column 39: > $text = preg_replace

Re: [PHP] stripping html tags

2005-06-05 Thread Dotan Cohen
On 6/5/05, Marek Kilimajer <[EMAIL PROTECTED]> wrote: > Dotan Cohen wrote: > > I took this example from php.net, but can't figure out where I went > > wrong. Why does this: > > $text = preg_replace("/(.|\s)*?<\/head>/i" , "" , $text); > > > > throw this error: > > syntax error at line 265, column 3

Re: [PHP] stripping html tags

2005-06-05 Thread Marek Kilimajer
Dotan Cohen wrote: I took this example from php.net, but can't figure out where I went wrong. Why does this: $text = preg_replace("/(.|\s)*?<\/head>/i" , "" , $text); throw this error: syntax error at line 265, column 39: $text = preg_replace("/(.|\s)*?<\/head>/i" , "" , $text);

Re: [PHP] stripping of the last character

2005-04-18 Thread Richard Lynch
On Mon, April 18, 2005 5:11 am, Chris Kay said: > > use substr($recipients,0,1); > to remove the last char > > and ereg_replace(","," ,",$recipients); > to add the spaces If the list is *REALLY* large, http://php.net/str_replace might be a bit faster. For sure, there's no need to haul out the

Re: [PHP] stripping of the last character

2005-04-18 Thread Chris Kay
use substr($recipients,0,1); to remove the last char and ereg_replace(","," ,",$recipients); to add the spaces Hope this helps CK On Mon, Apr 18, 2005 at 12:05:42PM +0100, Ross wrote: > I have a large group of email addesses serperated by commas. I need to trim > off the very last comma > >

Re: [PHP] stripping of the last character

2005-04-18 Thread Sebastian
$recipients = '[EMAIL PROTECTED],[EMAIL PROTECTED],[EMAIL PROTECTED],'; echo str_replace(',', ', ', substr($recipients, 0, -1)); - Original Message - From: "Ross" <[EMAIL PROTECTED]> > I have a large group of email addesses serperated by commas. I need to trim > off the very last comm

Re: [PHP] stripping negative number

2004-12-23 Thread Jason Wong
On Thursday 23 December 2004 16:18, Roger Thomas wrote: > I want to convert negative number to its positive equivalent. > > $num = -40; > printf("Unsigned value is %u", $num); > > output is: Unsigned value is 4294967256 > > I have checked the manpages and %u seems the right format. Pls advise. You

Re: [PHP] stripping negative number

2004-12-23 Thread tg-php
I believe this is because taking a value and displaying it as an unsigned value isn't the same as displaying the absolute value of a number. Ever take a calculator that does hex and decimal, enter a negative number then convert it to hex? There's no negative in hex, so you end up with something

Re: [PHP] stripping negative number

2004-12-23 Thread Justin England
unsigned does not equal absolute value. $num = -40; print "Num: $num\n"; $num = abs($num); print "ABS: $num\n"; will display: Num: -40 ABS: 40 http://us2.php.net/manual/en/function.abs.php Justin - Original Message - From: "Roger Thomas" <[EMAIL PROTECTED]> To: Sent: Thursday, December 23

Re: [PHP] stripping text from a string

2004-10-29 Thread sylikc
Adam, > Hi, I use a piece of proprietary software at work that uses weird session > ID strings in the URL. A sample URL looks like: > > http://zed2.mdah.state.ms.us/F/CC8V7H1JF4LNBVP5KARL4KGE8AHIKP1I72JSBG6AYQSMK8YF4Y-01471?func=find-b-0 > > The weird session ID string changes each time you lo

Re: [PHP] stripping content and parsing returned pages?

2004-03-15 Thread Richard Davey
Hello Dustin, Monday, March 15, 2004, 2:45:06 PM, you wrote: DW> I need to post to a login script, then once the page is processed, I will DW> parsed the returned page for the data after logined. any help please? One word for you: snoopy Oh and one URL too: http://snoopy.sourceforge.com It will

Re: [PHP] Stripping out all illegal characters for a folder name

2003-11-26 Thread Justin French
On Thursday, November 27, 2003, at 03:12 AM, Curt Zirzow wrote: I'd approach it the same way. preg_replace('/[^A-Za-z0-9_]/', '_', $dirname); I totally agree with Curt here. Justin French -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP] Stripping out all illegal characters for a folder name

2003-11-26 Thread Jay Blanchard
[snip] Sorry for the reply to the reply, but OExpress won't let me reply to newsgroup posts... [/snip] Had to laugh... :) AND BTW Happy Thanksgiving to all of our folks who celebrate that holiday! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.p

Re: [PHP] Stripping out all illegal characters for a folder name

2003-11-26 Thread CPT John W. Holmes
Sorry for the reply to the reply, but OExpress won't let me reply to newsgroup posts... From: "Sophie Mattoug" <[EMAIL PROTECTED]> > Joseph Szobody wrote: > >I'm taking some user input, and creating a folder on the server. I'm already > >replacing " " with "_", and stripping out a few known illega

Re: [PHP] Stripping out all illegal characters for a folder name

2003-11-26 Thread Curt Zirzow
* Thus wrote Sophie Mattoug ([EMAIL PROTECTED]): > Joseph Szobody wrote: > > >I'm taking some user input, and creating a folder on the server. I'm > >already > >replacing " " with "_", and stripping out a few known illegal characters > >(', > >", /, \, etc). I need to be sure that I'm stripping

Re: [PHP] Stripping out all illegal characters for a folder name

2003-11-26 Thread Sophie Mattoug
Joseph Szobody wrote: Folks, I'm taking some user input, and creating a folder on the server. I'm already replacing " " with "_", and stripping out a few known illegal characters (', ", /, \, etc). I need to be sure that I'm stripping out every character that cannot be used for a folder name. Wha

Re: [PHP] Stripping Decimals

2003-11-04 Thread Ed Curtis
Thanks! Works like a charm. Ed On Tue, 4 Nov 2003, CPT John W. Holmes wrote: > From: "Ed Curtis" <[EMAIL PROTECTED]> > > I currently use number_format() and str_replace() to remove a "," or "$" > > if entered and reformat it as a price for an item. I've asked the > > user not to use decimal

Re: [PHP] Stripping Decimals

2003-11-04 Thread CPT John W. Holmes
From: "Ed Curtis" <[EMAIL PROTECTED]> > I currently use number_format() and str_replace() to remove a "," or "$" > if entered and reformat it as a price for an item. I've asked the > user not to use decimals but some still do. How do I remove a decimal and > anything after from a number in a vara

RE: [PHP] Stripping Decimals

2003-11-04 Thread Jay Blanchard
[snip] I currently use number_format() and str_replace() to remove a "," or "$" if entered and reformat it as a price for an item. I've asked the user not to use decimals but some still do. How do I remove a decimal and anything after from a number in a varable? [/snip] http://www.php.net/explod

Re: [PHP] stripping comments

2003-10-05 Thread David Otton
On Sun, 5 Oct 2003 04:46:16 -0400, you wrote: >I'm trying to strip comments out of my code. I can get it to strip one >section of comments but the problem comes in when I have more then one >comment section to strip. > >I am using this: $code = preg_replace('/\/*(.*?)*\//is', '$1', $code) and >ne

RE: [PHP] stripping comments

2003-10-05 Thread zzz
Hey perfect Eugene, thanks -Original Message- From: Eugene Lee [mailto:[EMAIL PROTECTED] Sent: October 5, 2003 5:14 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] stripping comments On Sun, Oct 05, 2003 at 04:46:16AM -0400, zzz wrote: : : I'm trying to strip comments out of my cod

Re: [PHP] stripping comments

2003-10-05 Thread Marek Kilimajer
You will run into more problems and there are many things you need to consider, for example "/*" in a string. But token_get_all() will parse php code for you and will make things much simpler. zzz wrote: I'm trying to strip comments out of my code. I can get it to strip one section of comments

Re: [PHP] stripping comments

2003-10-05 Thread Eugene Lee
On Sun, Oct 05, 2003 at 04:46:16AM -0400, zzz wrote: : : I'm trying to strip comments out of my code. I can get it to strip one : section of comments but the problem comes in when I have more then one : comment section to strip. : : I am using this: $code = preg_replace('/\/*(.*?)*\//is', '$1',

Re: [PHP] Stripping out and URL hacking characters from a URL

2003-08-19 Thread CPT John W. Holmes
From: "Matt Babineau" <[EMAIL PROTECTED]> > Does anyone have a function or something they have already written to > remove any URL hacking characters, mainly the single quote, but I'm > looking for a nice function to filter my _GET variables against. Gotta > protect the database...ya know :) Just

RE: [PHP] Stripping out and URL hacking characters from a URL

2003-08-19 Thread Chris W. Parker
Matt Babineau on Tuesday, August 19, 2003 8:10 AM said: > Does anyone have a function or something they have already written to > remove any URL hacking characters, mainly the single quote, but I'm > looking for a nice function to filter my _GET variables against. Go

Re: [PHP] stripping newlines from a string

2003-06-09 Thread Philip Olson
On Mon, 9 Jun 2003, Charles Kline wrote: > Yes. Is weird. I thought this would work too, but for some reason it > was not removing them all. I wonder if re-saving the files with UNIX > linebreaks (or try DOS) would have any effect. Will report back. $str = str_replace (array("\r", "\n"), '', $s

Re: [PHP] stripping newlines from a string

2003-06-09 Thread Lars Torben Wilson
On Sun, 2003-06-08 at 22:44, Charles Kline wrote: > Hi all, > > How would i go about stripping all newlines from a string? > > Thanks, > Charles Something like this: Good luck, Torben -- Torben Wilson <[EMAIL PROTECTED]>+1.604.709.0506 http://www.thebuttlesschap

Re: [PHP] stripping newlines from a string

2003-06-08 Thread Charles Kline
Yes. Is weird. I thought this would work too, but for some reason it was not removing them all. I wonder if re-saving the files with UNIX linebreaks (or try DOS) would have any effect. Will report back. - Charles On Monday, June 9, 2003, at 02:24 AM, Joe Pemberton wrote: http://www.php.net/str

RE: [PHP] stripping newlines from a string

2003-06-08 Thread Boaz Yahav
How to remove new line / CrLf from a string http://examples.weberdev.com/get_example.php3?count=3577 Sincerely berber Visit http://www.weberdev.com/ Today!!! To see where PHP might take you tomorrow. -Original Message- From: Charles Kline [mailto:[EMAIL PROTECTED] Sent: Monday, June 0

Re: [PHP] stripping slashes before insert behaving badly

2003-03-17 Thread Foong
if Magic_quotes_gpc in you php.ini is set to 'on', php will automatically escape(add slashes) for you. Foong "Charles Kline" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > John, > > You are right, something was adding the additional slash. I removed the > addslashes() and it fixe

Re: [PHP] stripping slashes before insert behaving badly

2003-03-17 Thread Charles Kline
John, You are right, something was adding the additional slash. I removed the addslashes() and it fixed the problem. Something I am doing must already be handling that... will step through the code AGAIN and see if I can find it. - Charles On Monday, March 17, 2003, at 12:19 PM, John W. Holme

RE: [PHP] stripping slashes before insert behaving badly

2003-03-17 Thread John W. Holmes
> I am inserting data from a form into a mySQL database. I am using > addslashes to escape things like ' in the data input (this is actually > being done in PEAR (HTML_QuickForm). > > The weird thing is that the data gets written into the table like: > what\'s your problem? > > WITH the slash. I

Re: [PHP] stripping %20 and other characters from query string

2003-02-06 Thread Jonathan Pitcher
Sarah, There are a couple functions that could do this for you. Probably the fastest one for your example would be as follows. $NewString = str_replace('%20', ' ', $value); // Removes the %20 characters $NewString = str_replace '\', '', $NewString); // Removes \ character echo $NewString; htt

Re: [PHP] stripping %20 and other characters from query string

2003-02-06 Thread Jason k Larson
Try these: http://www.php.net/manual/en/function.urldecode.php http://www.php.net/manual/en/function.rawurldecode.php HTH, Jason k Larson Sarah Gray wrote: Hello, Forgive me if this is an obvious question, but I am passing a value (a string with spaces and quotations) back in a query string a

Re: [PHP] Stripping HTML tags, but keeping entities...

2002-11-20 Thread Justin French
on 21/11/02 2:25 AM, David Russell ([EMAIL PROTECTED]) wrote: > strip_tags($_POST['Duplicate'], ' > '); > > OK, so this is cool. I got this list from the Slashdot allowed tags > list, which I would assume is ok. Whoa there... NEVER assume because someone else does something that it'

Re: [PHP] Stripping HTML tags, but keeping entities...

2002-11-20 Thread @ Edwin
Hello, (B (B"David Russell" <[EMAIL PROTECTED]> wrote: (B (B...[snip]... (B (B> Strip_tags removes all info after the < sign. Obviously I would like to (B> convert it to a > entity, but how can I do both of these? (B (BHave you tried this? (B (B http://www.php.net/manual/en/function.p

Re: [PHP] Stripping specific tags

2002-09-19 Thread Justin French
on 20/09/02 1:14 PM, John Holmes ([EMAIL PROTECTED]) wrote: > I hope not. That would be a worthless function to have. Did you read my > post? The basic idea is validation is to allow what you _know_ is good, > and kill the rest. You don't kill a couple things you know are bad, then > assume the r

RE: [PHP] Stripping specific tags

2002-09-19 Thread John Holmes
> That's what I thought the answer would be. I guess I will have to see if I > can create a function to add to the next release of PHP to do this, as > there > certainly seems to be quite a demand for it, according to the archives > anyway. I hope not. That would be a worthless function to have.

RE: [PHP] Stripping specific tags

2002-09-19 Thread John Holmes
> I was wondering is there a way to strip ONLY the tags that you specify > from > a page, rather than having to include all the tags you do want (using > strip_tags() ) A regular expression or str_replace() would be best for this. Realize this isn't a good method, though. What if you're trying

Re: [PHP] Stripping illegal characters out of an XML document

2002-06-06 Thread Analysis & Solutions
Heya: On Thu, Jun 06, 2002 at 04:54:15PM +0100, Daniel Pupius wrote: > Thanks, I've created a delimited file of all the HTML Character references. > I then loop through and do a replace as previously suggested. However, > IE's XML Parser still doesn't like the é which represents é > > For all

Re: [PHP] Stripping illegal characters out of an XML document

2002-06-06 Thread Daniel Pupius
Thanks, I've created a delimited file of all the HTML Character references. I then loop through and do a replace as previously suggested. However, IE's XML Parser still doesn't like the é which represents é For all intents and purposes it's ok and works with the RDF processor. However, I'd like

Re: [PHP] Stripping illegal characters out of an XML document

2002-06-06 Thread Analysis & Solutions
On Thu, Jun 06, 2002 at 12:47:57PM +0100, Daniel Pupius wrote: > Hi there. I'm working with RDF/XML that is strict on what characters are > allowed within the elements and attributes. I was wondering if anyone had a > script that processed a string and replaced all illegal-characters with > their

Re: [PHP] Stripping characters.....

2002-04-27 Thread Justin French
Clarification: So really, what you want to achieve is to ONLY have the email address? I'm POSITIVE there's a better way with ereg_replace(), but I haven't got time to experiment, and i'm no expert :) So, what I figured was that you would loop through the $email, and if the first char wasn't a "<

RE: [PHP] Stripping the first line of a file

2002-02-08 Thread Scott
Thanks Jerry! In perl I was doing this: printf NEW ("%-193.193s"); Which I just read the manual and discovered it works in PHP as well. Basically prints 193 spaces to make sure the line is 255 after I filled the line with other characters. On Fri, 8 Feb 2002, Jerry Verhoef (UGBI) wrote

RE: [PHP] Stripping the first line of a file

2002-02-08 Thread Jerry Verhoef (UGBI)
printf NEW ("%-193.193s"); printf ("%-193.193s",); HTH > -Original Message- > From: Jerry Verhoef (UGBI) [mailto:[EMAIL PROTECTED]] > Sent: Friday, February 08, 2002 4:35 PM > To: 'Scott'; Jerry Verhoef (UGBI) > Cc: [EMAIL PROTECTED]

RE: [PHP] Stripping the first line of a file

2002-02-08 Thread Jerry Verhoef (UGBI)
Friday, February 08, 2002 4:22 PM > To: Jerry Verhoef (UGBI) > Cc: [EMAIL PROTECTED] > Subject: RE: [PHP] Stripping the first line of a file > > > Thank you! Works. I have a few more questions! I am working on > converting a program from perl to PHP as it is the new >

RE: [PHP] Stripping the first line of a file

2002-02-08 Thread Scott
Thank you! Works. I have a few more questions! I am working on converting a program from perl to PHP as it is the new language of choice at our office. I have been using printf statements in perl to format data. Is there a similar funtion in php? Here is an example from the perl program:

RE: [PHP] Stripping the first line of a file

2002-02-08 Thread Jerry Verhoef (UGBI)
Use $aFile=file(); //$aFile[0] contains the unwanted line echo $aFile[1]; // displays line 2 echo $aFile[n]; // displays line n where n is an positieve interger and not greater then the number of lines in the file http://www.php.net/manual/en/function.file.php HTH Jerry > -Original Mes

Re: [PHP] Stripping slashes from db-insert?

2001-12-01 Thread Shane Wright
Addslashes() is probably getting called twice on the data on the insert... if you have magic_gpc on, any inputted data already has the necessary escapes - so you shouldnt need to call it again... Hope that helped :) -- Shane On Saturday 01 Dec 2001 1:14 pm, Daniel Alsén wrote: > Hi, > > i kn

RE: [PHP] Stripping single quotes

2001-07-28 Thread Matt Stone
Thanks for your help everyone, I feel pretty embarrassed to have made a mistake like that! :o -Original Message- From: Bojan Gajic [mailto:[EMAIL PROTECTED]] Sent: Sunday, 29 July 2001 12:44 AM To: Matt Stone Subject: Re: [PHP] Stripping single quotes you are not assigning

RE: [PHP] Stripping single quotes

2001-07-28 Thread Michael Hall
Any ideas? Thanks, > > Matt Stone > > -Original Message----- > From: Chris Fry [mailto:[EMAIL PROTECTED]] > Sent: Saturday, 28 July 2001 2:15 PM > To: Matt Stone > Cc: PHP list > Subject: Re: [PHP] Stripping single quotes > > > Matt, > > Try ereg

RE: [PHP] Stripping single quotes

2001-07-28 Thread Matt Stone
Any ideas? Thanks, Matt Stone -Original Message- From: Chris Fry [mailto:[EMAIL PROTECTED]] Sent: Saturday, 28 July 2001 2:15 PM To: Matt Stone Cc: PHP list Subject: Re: [PHP] Stripping single quotes Matt, Try ereg_replace:- $fldemail == ereg_replace("'","&qu

Re: [PHP] Stripping single quotes

2001-07-27 Thread Chris Fry
Matt, Try ereg_replace:- $fldemail == ereg_replace("'","",$fldemail); Chris Matt Stone wrote: > Hi all, > I am trying to validate some email addresses before they are entered into > the database. > The problem is, some thick or malicious people are entering single quotes > into their email a

RE: [PHP] stripping white space?

2001-07-10 Thread Brian White
we know the headaches us developers can face in the >future. > >Sincerely, > Navid Yar > > >-Original Message- >From: Maxim Maletsky [mailto:[EMAIL PROTECTED]] >Sent: Tuesday, July 10, 2001 1:06 AM >To: '[EMAIL PROTECTED]'; [EMAIL PROTECTED] >Su

RE: [PHP] stripping white space?

2001-07-10 Thread Chadwick, Russell
r [mailto:[EMAIL PROTECTED]] Sent: Tuesday, July 10, 2001 9:52 AM To: Maxim Maletsky; 'Bart Veldhuizen'; [EMAIL PROTECTED] Subject: Re: [PHP] stripping white space? On Tuesday 10 July 2001 11:26, Maxim Maletsky wrote: > But you're right, on UNIX systems, if I am not wrong, you cannot

  1   2   >