On Thu, Apr 22, 2010 at 1:29 PM, Paul Halliday wrote:
> Ex:
>
> "This is the string and it is this long"
>
> This is
> the string
> and it
> is this
> long
>
> I found some long functions to achieve this but I couldn't help but
> think that it could be done in a couple lines.
>
> Possible?
>
> Tha
Thank you very much!
Understand. And it Works very well now.
Cheers
-Mensagem original-
De: Ford, Mike [mailto:m.f...@leedsmet.ac.uk]
Enviada: quinta-feira, 23 de Julho de 2009 00:04
Para: php-general@lists.php.net
Assunto: RE: [PHP] Replace in a string with regex
> -Origi
> -Original Message-
> From: rszeus [mailto:rsz...@gmail.com]
> Sent: 22 July 2009 19:23
> To: 'Jim Lucas'
> Cc: 'Kyle Smith'; 'Eddie Drapkin'; a...@ashleysheridan.co.uk; php-
> gene...@lists.php.net
> Subject: RE: [PHP] Replace in a strin
Enviada: quarta-feira, 22 de Julho de 2009 18:44
> Para: rszeus
> Cc: 'Kyle Smith'; 'Eddie Drapkin'; a...@ashleysheridan.co.uk;
> php-general@lists.php.net
> Assunto: Re: [PHP] Replace in a string with regex
>
> rszeus wrote:
>> Thank you.
l-
De: Jim Lucas [mailto:li...@cmsws.com]
Enviada: quarta-feira, 22 de Julho de 2009 18:44
Para: rszeus
Cc: 'Kyle Smith'; 'Eddie Drapkin'; a...@ashleysheridan.co.uk;
php-general@lists.php.net
Assunto: Re: [PHP] Replace in a string with regex
rszeus wrote:
> Thank you. I unde
7;test';
>
> echo preg_replace('#(screen/)temp/(.+?)_1(.+?\.jpg)#', '$1'.$id, $file);
>
> I get screen/test
>
>
>
> Any ideas ?
>
>
>
> Thank you
>
>
>
> De: Kyle Smith [mailto:kyle.sm...@inforonics.com]
> Enviada: quart
uarta-feira, 22 de Julho de 2009 17:22
Para: rszeus
Cc: 'Eddie Drapkin'; a...@ashleysheridan.co.uk; 'Jim Lucas';
php-general@lists.php.net
Assunto: Re: [PHP] Replace in a string with regex
The first match inside () is assigned to $1, the second is assigned to $2, and
so on
ginal-
De: Eddie Drapkin [mailto:oorza...@gmail.com]
Enviada: quarta-feira, 22 de Julho de 2009 14:12
Para: rszeus
Cc: php-general@lists.php.net
Assunto: Re: [PHP] Replace in a string with regex
On Wed, Jul 22, 2009 at 9:07 AM, rszeus wrote:
Hi. It Works to remove the _1 but it doesn
...
-Mensagem original-
De: Eddie Drapkin [mailto:oorza...@gmail.com]
Enviada: quarta-feira, 22 de Julho de 2009 16:03
Para: a...@ashleysheridan.co.uk
Cc: Jim Lucas; rszeus; php-general@lists.php.net
Assunto: Re: [PHP] Replace in a string with regex
On Wed, Jul 22, 2009 at 11:01 AM, Ashle
On Wed, Jul 22, 2009 at 11:01 AM, Ashley
Sheridan wrote:
> On Wed, 2009-07-22 at 07:54 -0700, Jim Lucas wrote:
>> Sure that can be done. But you will need to change the second argument
>> to have double quotes so it will be parsed by PHP.
>>
>> Then I would surround YOUR variable with curly bracke
quot;$1{$id}$3",
>> $file);
>>
>> > I am confusing " and '.
>> >
>> > Thank you
>> >
>> >
>> > -Mensagem original-
>> > De: Eddie Drapkin [mailto:oorza...@gmail.co
>
> > -Mensagem original-
> > De: Eddie Drapkin [mailto:oorza...@gmail.com]
> > Enviada: quarta-feira, 22 de Julho de 2009 14:12
> > Para: rszeus
> > Cc: php-general@lists.php.net
> > Assunto: Re: [PHP] Replace in a string with regex
> >
"$1{$id}$3",
$file);
> I am confusing " and '.
>
> Thank you
>
>
> -Mensagem original-
> De: Eddie Drapkin [mailto:oorza...@gmail.com]
> Enviada: quarta-feira, 22 de Julho de 2009 14:12
> Para: rszeus
&g
27;.
Thank you
-Mensagem original-
De: Eddie Drapkin [mailto:oorza...@gmail.com]
Enviada: quarta-feira, 22 de Julho de 2009 14:12
Para: rszeus
Cc: php-general@lists.php.net
Assunto: Re: [PHP] Replace in a string with regex
On Wed, Jul 22, 2009 at 9:07 AM, rszeus wrote:
>
You can disregard this, it's wrong (I missed a part of the requirements
:) and there's other solutions already provided (my email client is
weird when you switch to a folder it always displays the first entry as
the last read, so sometimes I miss that there are new posts above... I
just switche
rszeus wrote:
Hello,
I’m tryng to make some replacements on a string.
Everything goês fine until the regular expression.
$file = "screens/temp/7a45gfdi6icpan1jtb1j99o925_1_main.jpg";
echo $a = str_replace(array(7a45gfdi6icpan1jtb1j99o925,
'temp/',’_([0-9])’), array(“test”,"",””), $file)
leysheridan.co.uk]
Enviada: quarta-feira, 22 de Julho de 2009 13:20
Para: rszeus
Cc: php-general@lists.php.net
Assunto: Re: [PHP] Replace in a string with regex
On Wed, 2009-07-22 at 13:02 +0100, rszeus wrote:
> Hello,
>
> I’m tryng to make some replacements on a string.
>
> Ever
a: quarta-feira, 22 de Julho de 2009 13:11
> Para: rszeus
> Cc: php-general@lists.php.net
> Assunto: Re: [PHP] Replace in a string with regex
>
> On Wed, Jul 22, 2009 at 8:02 AM, rszeus wrote:
>> Hello,
>>
>> I’m tryng to make some replacements on a string.
>>
Hi. It Works to remove the _1 but it doesn't replace
'7a45gfdi6icpan1jtb1j99o925' for 'test'
Thank you
-Mensagem original-
De: Eddie Drapkin [mailto:oorza...@gmail.com]
Enviada: quarta-feira, 22 de Julho de 2009 13:11
Para: rszeus
Cc: php-general@lists.
On Wed, 2009-07-22 at 13:02 +0100, rszeus wrote:
> Hello,
>
> I’m tryng to make some replacements on a string.
>
> Everything goês fine until the regular expression.
>
>
>
> $file = "screens/temp/7a45gfdi6icpan1jtb1j99o925_1_main.jpg";
>
> echo $a = str_replace(array(7a45gfdi6icpan1jtb1j99o
On Wed, Jul 22, 2009 at 8:02 AM, rszeus wrote:
> Hello,
>
> I’m tryng to make some replacements on a string.
>
> Everything goês fine until the regular expression.
>
>
>
> $file = "screens/temp/7a45gfdi6icpan1jtb1j99o925_1_main.jpg";
>
> echo $a = str_replace(array(7a45gfdi6icpan1jtb1j99o925,
> 't
Rahul Sitaram Johari wrote:
> Ave,
>
> Can¹t figure this one out. I¹m using the dbase_replace_record() function to
> replace a record in a dbase (.dbf) database. I just want to replace the
> value of one of the fields with another value. This is my code:
>
> $db = dbase_open("CRUMBS.DBF", 2) or d
Rafael Mora wrote:
> Hi!
>
> i want to send a file or output stream in a .php, but first compress it, I
> tryed the example to compress files but how do i do to send as answer to
> the
> http request??
trye the other example
>
> Rafa
>
--
PHP General Mailing List (http://www.php.net/)
To un
Hi!
i want to send a file or output stream in a .php, but first compress it, I
tryed the example to compress files but how do i do to send as answer to the
http request??
Rafa
At 5:04 PM +0200 8/29/06, Reinhart Viane wrote:
About the language remark:
I believe you try to say I need to find a way that the client can add 25
languages without me having to change the database layout or the coding?
Well I can assure you this will not be the fact. The client only needs these
8:37 PM
To: [EMAIL PROTECTED]
Cc: php-general@lists.php.net
Subject: Re: [PHP] replace single and double quotes
Reinhart Viane wrote:
> This is the code is use to insert/update text into a database field:
>
> $sqledit="update activities set act_extra='$_POST[editextra]',
: dinsdag 29 augustus 2006 15:37
> Aan: [EMAIL PROTECTED]
> CC: php-general@lists.php.net
> Onderwerp: Re: [PHP] replace single and double quotes
>
> Reinhart Viane wrote:
>> This is the code is use to insert/update text into a database field:
>>
>> $sqledit=&quo
Ok 'ill give this a shot together with the guidelines from jochen.
Thx afan.
-Oorspronkelijk bericht-
Van: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Verzonden: dinsdag 29 augustus 2006 15:28
Aan: [EMAIL PROTECTED]
CC: php-general@lists.php.net
Onderwerp: Re: [PHP] replace singl
, didn't think this question was about to bring up what I was
looking for in the back of my head
-Oorspronkelijk bericht-
Van: Jochem Maas [mailto:[EMAIL PROTECTED]
Verzonden: dinsdag 29 augustus 2006 15:37
Aan: [EMAIL PROTECTED]
CC: php-general@lists.php.net
Onderwerp: Re: [PHP] replace s
ot;, $act_extra, $act_extra_fr, $act_id);
Notice the %d for the id part if $act_id should be integer.
/Peter
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Tuesday, August 29, 2006 8:28 PM
To: [EMAIL PROTECTED]
Cc: php-general@lists.php.net
Subject: Re: [PHP] re
Reinhart Viane wrote:
> This is the code is use to insert/update text into a database field:
>
> $sqledit="update activities set act_extra='$_POST[editextra]',
> act_extra_fr='$_POST[editextrafr]' where act_id=$_POST[editid]";
this indicates 'bad' database design ... because adding a language inv
[EMAIL PROTECTED] wrote:
> since I had something similar as a problem, let m etry to anser ang see
> did I get it correct :)
seems ok ...
>
> first, and most important: never store in DB row submitted string
>
> $act_extra = mysql_real_escape_string($_POST[editextra]);
> $act_extra_fr = mysql_r
since I had something similar as a problem, let m etry to anser ang see
did I get it correct :)
first, and most important: never store in DB row submitted string
$act_extra = mysql_real_escape_string($_POST[editextra]);
$act_extra_fr = mysql_real_escape_string($_POST[editextrafr])
$act_id = mysql
I hope this is what you were looking for:
$contents = "Numbers 1, 2, 3, 4 and 5 will be replaced with A, B, C, D, and E";
$searcharr = array("1", "2", "3", "4", "5");
$replacearr = array("A", "B", "C", "D", "E");
$newcontents = str_replace($searcharr, $replacearr, $contents);
echo $newcontents;
John Taylor-Johnston wrote:
Can someone show me how to get rid of international characters in
$string? Is there a function already made?
the acute/grave accents on the chars are called 'diacritics'
You cannot use accented characters in a name reference : name="montréal">.
I guess this below i
Look into strtr()
http://www.php.net/strtr
It seems to be precisely what you want.
John Taylor-Johnston wrote:
Can someone show me how to get rid of international characters in
$string? Is there a function already made?
You cannot use accented characters in a name reference : name="montréal">
On Thursday 24 February 2005 16:14, Frank Arensmeier wrote:
> 1) replace ".." with a string like "file://server/folder"
> 2) replace all "\" characters with "/".
>
> The PHP code looks something like:
>
> $path_to_file = "..\1 PDF Filer\65051.PDF";
$path_to_file = '..\1 PDF Filer\65051.PDF';
D
blackwater dev wrote:
thanks...I will look that up. Not very good with regular expressions though.
this is your chance to get a bit better. have a go,
if you get stuck post your code :-)
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
thanks...I will look that up. Not very good with regular expressions though.
On Fri, 28 Jan 2005 08:11:59 -0800 (PST), Richard Lynch <[EMAIL PROTECTED]>
wrote:
> blackwater dev wrote:
> > I have a section of my site that uses HTMLArea to allow the users to
> > manage content. For one certain s
blackwater dev wrote:
> I have a section of my site that uses HTMLArea to allow the users to
> manage content. For one certain section, they want all of their links
> to pop up in another window. I know they can use HTMLArea and add
> this code themselves but they don't want to get to the code si
On Tue, 25 Jan 2005 16:29:38 -, Chris Ramsay
<[EMAIL PROTECTED]> wrote:
>
>
> >Hey!
> >I just got this emai lfrom RIPN mail processor at Moscow ?!?!?!?!?
>
>
>
> I have received this also with both my postings today...and probably will
> again...
>
I've just sent ONE message to the list
Mike Johnson wrote:
From: Richard Davey [mailto:[EMAIL PROTECTED]
Hello Afan,
Tuesday, January 25, 2005, 4:12:43 PM, you wrote:
AP> Hey!
AP> I just got this emai lfrom RIPN mail processor at Moscow ?!?!?!?!?
Join the club.. everyone who posts gets one. Annoying, no?
Best regards,
Richard Davey
>Hey!
>I just got this emai lfrom RIPN mail processor at Moscow ?!?!?!?!?
I have received this also with both my postings today...and probably will
again...
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Hello Chris,
Tuesday, January 25, 2005, 5:07:37 PM, you wrote:
CR> Maybe that's another thing to add to the [NEWBIE GUIDE] - I would have found
CR> it useful! ;)
Ahh... so you're the Russian mail server? :)
I guess we could add "don't be a twat with your auto-responders" to
the newbie faq, but
Join the club.. everyone who posts gets one. Annoying, no?
Maybe that's another thing to add to the [NEWBIE GUIDE] - I would have found
it useful! ;)
Chris Ramsay
-
Web Developer - The Danwood Group Ltd.
T: +44 (0) 1522 834482
F: +
Not at all... Actually, I enjoy :-D
I just wonder what's going on and is it problem on my side or... Now I
breath easier...
;-)
-afan
Richard Davey wrote:
Hello Afan,
Tuesday, January 25, 2005, 4:12:43 PM, you wrote:
AP> Hey!
AP> I just got this emai lfrom RIPN mail processor at Moscow ?!?!?!?!
From: Richard Davey [mailto:[EMAIL PROTECTED]
> Hello Afan,
>
> Tuesday, January 25, 2005, 4:12:43 PM, you wrote:
>
> AP> Hey!
> AP> I just got this emai lfrom RIPN mail processor at Moscow ?!?!?!?!?
>
> Join the club.. everyone who posts gets one. Annoying, no?
>
> Best regards,
>
> Richard
[snip]
I just got this emai lfrom RIPN mail processor at Moscow ?!?!?!?!?
What's going on?
[/snip]
I have been getting it with every send too...off to /dev/null
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Hello Afan,
Tuesday, January 25, 2005, 4:12:43 PM, you wrote:
AP> Hey!
AP> I just got this emai lfrom RIPN mail processor at Moscow ?!?!?!?!?
Join the club.. everyone who posts gets one. Annoying, no?
Best regards,
Richard Davey
--
http://www.launchcode.co.uk - PHP Development Services
"I a
Jay Blanchard wrote:
[snip]
I need to replace all the numbers of a credit card except for the last
4 with an 'X' ... can't seem to locate the string function for this...
can someone point me in the right direction here to what php item i
should be using.
[/snip]
ROFLMMFAO! It's all been discussed b
In addition to what was mentioned already, using ereg_replace, if you're
pulling the CC# string out of a database of off of some POST data or something,
just use a substr() function to pull the last 4 digits and prepend a bunch of
X's.
$ccnum = "342342522342342"; # fake CC #, prob not even cor
Joe Harman wrote:
Hello,
I need to replace all the numbers of a credit card except for the last
4 with an 'X' ... can't seem to locate the string function for this...
can someone point me in the right direction here to what php item i
should be using.
that'll be:
string php_replace_all_but_last_fou
Hey!
I just got this emai lfrom RIPN mail processor at Moscow ?!?!?!?!?
What's going on?
-afan
Original Message
Subject: DNS.050125191312.29782 (Re: Re: [PHP] Replace credit card
numbers with X ???)
Date: Tue, 25 Jan 2005 19:13:27 +0300
From: RIPN NCC <[EMAIL PROTEC
this is my way.
$cc_stars = '';
$cc_no_lenght = strlen($cc_number);
$cc_info_first4 = substr($cc_number, 0, 4);
$cc_info_last4 = substr($cc_number, (strlen($cc_number) - 4), 4);
for($i=0; $i<($cc_no_lenght-8); $i++) $cc_stars .= '*';
$cc_number = $cc_info_f
[snip]
I need to replace all the numbers of a credit card except for the last
4 with an 'X' ... can't seem to locate the string function for this...
can someone point me in the right direction here to what php item i
should be using.
[/snip]
ROFLMMFAO! It's all been discussed before Joe!
http://
Hi,
> > I have a string: ##CODE## and I want to replace that with > href="somewhere.php?id=CODE">CODE
I handle %code% tags in some templates I use... here's the code I have..
function show ($template, $tag) {
$file = fopen ($template, "r") or
die($error_
$var="##testcode##this is a ##code1## test of the ##code2## code
replacement system ##code3##";
$varParsed=strParse($var);
echo "$var";
echo $varParsed;
function strParse($origString)
{
while ( $offsetFALSE)
{
$tmpString=substr($origString, $lastEnd, $foundBeg-$lastEnd);
$tm
id.'">',
$orig_text);
$new_text = str_replace( '#/', '', $new_text);
see:
http://www.php.net/manual/en/ref.strings.php
HTH
Graham
-Original Message-
From: Gareth Williams [mailto:[EMAIL PROTECTED]
Sent: 30 September 2004 09:38
To: mario
Cc: [EMAIL PROTECTED]
S
Well, if you can do it without a regex, then it's always best, because
the regex engine slows things down.
On 30 Sep 2004, at 10:39, mario wrote:
Hi all
I have a string: ##CODE## and I want to replace that with CODE
can u help?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, vis
At 17:51 14-09-2004, Diana Castillo wrote:
Anyone know of any function to replace letters with accents with just the
regular letter, for instance replace á with a,
ç with c, ñ with n ?
How about this ??? This is the one I made for this purpose
function stripAccents($string) {
$returnString = strt
Diana Castillo wrote:
Anyone know of any function to replace letters with accents with just the
regular letter, for instance replace á with a,
ç with c, ñ with n ?
found this on the strtr() manual page (http://php.net/strtr):
'TH', 'þ' => 'th', 'Ð' => 'DH', 'ð' => 'dh',
'ß' => 'ss', 'Œ'
Diana Castillo wrote:
Anyone know of any function to replace letters with accents with just the
regular letter, for instance replace á with a,
ç with c, ñ with n ?
$string = str_replace(array('á', 'ç', 'ñ'), array('a', 'c', 'n'), $string);
--
PHP General Mailing List (http://www.php.net/)
To uns
On Tue, 14 Sep 2004 17:51:00 +0200, Diana Castillo <[EMAIL PROTECTED]> wrote:
> Anyone know of any function to replace letters with accents with just the
> regular letter, for instance replace á with a,
> ç with c, ñ with n ?
str_replace(), eregi_replace()
--
Greg Donald
http://destiney.com/
-
> Jay Blanchard wrote:
> > Yes, anything is possible.
>
> Can I be the next Queen of England?
>
> --
> John C. Nichel
Anythings possible...and with all your choices you
want to be an old fart??
:-)
=
--
- The faulty interface lies between the chair and the keyboard.
- Creativity
Jay Blanchard wrote:
Yes, anything is possible.
Can I be the next Queen of England?
--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
[snip]
Is it possible to replace a button by an image with
PHP?
[/snip]
Yes, anything is possible. http://phpbutton.sourceforge.net/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
On Monday 26 July 2004 10:09, Turbo wrote:
> I have array variable and string variable.
> I want to replace value of array by key of array in string variable
> with preg_replace().
>
> Example :
> $message=array(
> 'name'=>'My Computer',
> 'version'=>'1.0'
> );
> $strValue="I am $name,build versi
str_replace(" ","+",$var);
-- red
Vernon wrote:
I want to be able to replace a space that comes from a form field (such as
in 123 My Street) with a + sign.
Can anyone help me with this?
Thanks
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
http://www.php.net/str-replace
On Wed, 2004-03-17 at 15:48, Vernon wrote:
> I want to be able to replace a space that comes from a form field (such as
> in 123 My Street) with a + sign.
>
> Can anyone help me with this?
>
> Thanks
--
Adam Voigt
[EMAIL PROTECTED]
--
PHP General Mailing List (
so, and still works fine. Why not stay with a winner?
-Original Message-
From: Brent Baisley
To: carlos castillo
Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: 2004-02-17 21:02
Subject: [PHP-WIN] Re: [PHP] Replace of ' in a query
Look at the addslashes command. You should always e
Look at the addslashes command. You should always escape the values you
are accepting from user input. If you read almost any article on web
site security, it will mention something called SQL injection among
other things. This is a way to compromise your data.
For instance, what if a user enter
--- carlos castillo <[EMAIL PROTECTED]> wrote:
> Hi , i have the following problem, i have a form where a user can input
> any text, on that text may be a char is ' char(39) when i try to execute
> the sql query, i have an error for that ', i need to replace it for the
> html tag, for example " is
Diana Castillo wrote:
How do I replace all single quotes with double quotes in a string for
echoing it with the double quotes?
By looking here...
http://us4.php.net/str_replace
--
By-Tor.com
It's all about the Rush
http://www.by-tor.com
--
PHP General Mailing List (http://www.php.net/)
To unsubs
str_replace(''',"'", $StringToReplace);
should work
-Original Message-
From: Diana Castillo [mailto:[EMAIL PROTECTED]
Sent: Wednesday, February 11, 2004 4:33 PM
To: [EMAIL PROTECTED]
Subject: [PHP] replace ' with "
How do I replace all single quotes with double quotes in a string for
e
Diana Castillo wrote:
How do I replace all single quotes with double quotes in a string for
echoing it with the double quotes?
$text = str_replace("'", '"', $text);
http://php.net/str_replace and please at least RTFM before posting here
in future.
--
Stuart
--
PHP General Mailing List (http://ww
on Tue, 2 Dec 2003 23:46:33 +0100 I already wrote, regarding replacing
macro %rand[x]-[y] with random of random length ([x]-[y]).
Before, I had my own (slow!) procedure to find next occurence of the
macro and generated a new string, which was returned.
This took about 15 seconds for 10.000 addres
on 02 Dec 2003 18:56:28 -0500 Robert Cummings wrote:
RC> I missed the original post, and I'm too lazy to go looking, but the
RC> following code runs in approx. 2.75 seconds on my Athlon 2400 running
RC> linux:
it is 4.3 seconds on xp 1600+..
RC> $chars = '0123456789'
RC> .'abcdef
on Tue, 2 Dec 2003 23:33:47 + Richard Davey wrote:
RD> Just so we're clear on this - you're creating a string (an email
RD> address) of a million characters? I don't know my mail RFC's that well, but
RD> I'm sure this is well beyond what it considers "standard".
We're not clear.. ;)
the funct
On Tue, 2003-12-02 at 18:33, Richard Davey wrote:
> Hello Daniel,
>
> Tuesday, December 2, 2003, 10:46:33 PM, you wrote:
>
> dh> For generation of a random string with length 1.000.000 it takes about
> dh> 13 seconds on my xp 1600+.. that's quite a lot, imho, so suggestions
> dh> are very welcome
Hello Daniel,
Tuesday, December 2, 2003, 10:46:33 PM, you wrote:
dh> For generation of a random string with length 1.000.000 it takes about
dh> 13 seconds on my xp 1600+.. that's quite a lot, imho, so suggestions
dh> are very welcome..
Just so we're clear on this - you're creating a string (an e
* Thus wrote ada ([EMAIL PROTECTED]):
> > What do you mean trim() doesn't work?
>
> trim is a basic function that remove spaces on the left and the right at the
> string :
> " abc"->"abc"
trim() removes more than spaces, please read:
http://php.net/trim
What I meant in my original post wa
> What do you mean trim() doesn't work?
trim is a basic function that remove spaces on the left and the right at the
string :
" abc"->"abc"
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
* Thus wrote ada ([EMAIL PROTECTED]):
> select hex("a
> ")
> ->
> 610D0A
> always 0D0A at the ends :(
>
> I' m on windows, and i didn't manage to destroy this peace of string :(
> trim() doesn't work ...
What do you mean trim() doesn't work?
Curt
--
If eval() is the answer, you're almost cert
Victor Spång Arthursson wrote:
Are there any good function to replace special characters, for example
double qoutes, with something that are more html-safe?
If only the PHP gods would bless us with a function such as
htmlspecialchars() or maybe even htmlentities()... what a great world it
would
2003-11-05 kl. 16.07 skrev Pavel Jartsev:
Try "htmlspecialchars()" and/or "htmlentities()".
htmlentities() did it best!
Thanks,
/.v
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Victor Spång Arthursson wrote:
Are there any good function to replace special characters, for example
double qoutes, with something that are more html-safe?
For example:
The above is generated with PHP and fetched from a database
(postgresql). I'ld like to have the double qoutes replaced with
[snip]
Are there any good function to replace special characters, for example
double qoutes, with something that are more html-safe?
[/snip]
http://www.php.net/str_replace
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
- Original Message -
From: WebDev <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, March 12, 2003 1:24 AM
Subject: Re: [PHP] replace question
Hello
How could I know recognize a URL in $a
$a contains often a URL htp://www.mysite.com but as well more tex
- Original Message -
From: WebDev <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, March 12, 2003 1:24 AM
Subject: Re: [PHP] replace question
Hello
How could I know recognize a URL in $a
$a contains often a URL htp://www.mysite.com but as well more tex
> how do we replace this out of an array element
>
> "~nl~" with " "
How about str_replace()? Or are you talking about replacing that value
in each and every element in the array? If so, use array_walk() or loop
through the array and use str_replace().
---John W. Holmes...
PHP Architect - A
7;s allow punctation
also...[:print:]
> will cover this.
>
> Now only if php supported [:control:] and [:graph:] :)
>
> -Peter
>
> > -Original Message-
> > From: Shawn McKenzie [mailto:nospam@;mckenzies.net]
> > Sent: Friday, October 25, 2002 04:48
> >
ported [:control:] and [:graph:] :)
-Peter
> -Original Message-
> From: Shawn McKenzie [mailto:nospam@;mckenzies.net]
> Sent: Friday, October 25, 2002 04:48
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] Replace illegal filename chars???
>
>
> Doesn't work. It retu
Doesn't work. It returned the same as what I put in: What's Up Doc?
-Shawn
"Maxim Maletsky" <[EMAIL PROTECTED]> wrote in message
news:20021024122630.4E99.MAXIM@;php.net...
>
> Use a regular expression like:
>
> $str = ereg_replce("/[^[:alnum:]]/i", '', $str);
>
>
> --
> Maxim Maletsky
> [EMAIL
John, et al --
...and then John Holmes said...
%
% Okay, you got me on that one, but why do you need to remove the
In my case, I had a newline-delimited file of
field@@data
field@@data
field@@data
and when the data had an embedded newline like
comment@@this is a
long comment
fiel
page explains this correctly, btw. It says that a ""
will be inserted before all newlines.
---John Holmes...
> -Original Message-
> From: David T-G [mailto:[EMAIL PROTECTED]]
> Sent: Monday, September 23, 2002 7:10 AM
> To: PHP General list
> Cc: John Holmes; '
John, et al --
...and then John Holmes said...
%
% > If i have a textarea form input for users and they enter in return
% spaces,
% > how can i replace the ascci chars with html tags?
%
% It'd be great if they had a function for this...they could call it
% nl2br() or something...
Yeah. It wou
> If i have a textarea form input for users and they enter in return
spaces,
> how can i replace the ascci chars with html tags?
It'd be great if they had a function for this...they could call it
nl2br() or something...
www.php.net/nl2br
---John Holmes...
--
PHP General Mailing List (http://
str_replace is your friend in this situation
Jason Reid
[EMAIL PROTECTED]
--
AC Host Canada
www.achost.ca
- Original Message -
From: "Alexander Lindstedt" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, August 16, 2002 6:05 PM
Subject: [PHP] Replace
> If i want to find just
(This is more info on the question I asked before)
Here's the text file (text.txt):
This is a test of the templating program.
Here's hoping it's working!
John Smith
Here's one line from the CSV file (new_data.csv):
John,Smith,"4770 Rosepetal Ct., Richmond, VA 22032 USA",(703
On Sun, 5 May 2002, Josh & Valerie McCormack wrote:
> I'm iterating through a CSV file pulling in rows as arrays with fgetcsv
> and I'd like to search for patterns made up of the first two array items
> of each row with a space between them in a text file, and make them into
> links. I can't fi
1 - 100 of 120 matches
Mail list logo