php-windows Digest 1 Feb 2007 13:59:34 -0000 Issue 3126

Topics (messages 27423 through 27428):

Here is how to 'sniff http'
        27423 by: git

using preg_replace or equivelent
        27424 by: Derek C Hopkins
        27425 by: Phillip Terry
        27427 by: Derek C Hopkins

Eclipse PHP Plugins
        27426 by: Bill Bolte

Back button in PHP
        27428 by: Alf Stockton

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [email protected]


----------------------------------------------------------------------
--- Begin Message ---
All,

I thought this might be of use to you and maybe even the guys at Angler. 

On the news groups and email lists I frequent I often find people wanting to 
know what is exactly happening between a server and client.  The snag is that I 
could not find written up any method that would work on any platform for any 
browser without having to change the browser settings etc.

So - I delved into the trashcan that is my memory and came up with this:

http://nerds-central.blogspot.com/2007/01/sniff-http-for-free-find-out-what-is.html

Let me know if it is of any use.

Best wishes

AJ

-- 
Nerds-Central:
nerds-central.blogspot.com

--- End Message ---
--- Begin Message ---
Hi All

Not knowing cgi-script I am having trouble understanding the preg_replace function in PHP.

What I want to do is remove all ocurances of the following items from a string

All spaces, open brackets, close brackets, apostriphy, and period (full stop)

        from a string  such as these

Audlin,Mary Ann,Spalding,14,412
Audsley,David.,Leeds,23,354
Audsley,David (Male),Leeds,23,354
Audsley,David O'Shannesey,Leeds,23,354

My thoughts were the following code

But it does not work

# need to remove punctuation in forname, ( . ) ZZZZZZZZZZZZZZZZZZZZZZZZZZZZ $patterns[0] = '/./'; $pattern[1] = '/(/'; $pattern[2] = '/)/'; $pattern[3] = "'"; $pattern[4] = '/ /'; $replacements[0] = "-"; $replaements[1] = "2"; $replacements[2] = "3"; $replaements[3] = "4";
 $forname = preg_replace($patterns,$replacements ,$forname);
 $surname = preg_replace($patterns,$replacements ,$surname);

What happens is all characters get changed to  -   (the first 0  replacement.

Any help with this or another solution would be appreciated.



Cheers Derek

Derek C Hopkins,                     Phone    +1(450)678-7768
6640, Biarritz,                          Fax      +1(450)678-4252
Brossard,                                E-Mail   [EMAIL PROTECTED]
QC,  Canada,  J4Z-2A2.

==== FreeBMD - England and Wales - Birth - Marriage and Death Transcriptions
<http://FreeBMD.rootsweb.com>

==== Check out FreeBMD Scan2 Syndicate page (revised daily)
Please bookmark our new home http://www.scan2.ca/scan2.html

==== Check out QFHS Marriage Transcription Project page (revised daily)
(Quebec Family History Society)
Please bookmark our new home http://www.scan2.ca/qfhs.html

Check out my web page (22jan1997) Last Revised 28 May 1998
<http://www.cam.org/~hopkde/index.html>

Check out Abney Park Indexing Project (revised 14 MAR 2000, 195,000 names)
<http://www.cam.org/~hopkde/abney.html>

Check out my web Ramsgate page
<http://members.adept.co.uk/hopkde>

Check out the Quebec Family History web page
<http://www.qfhs.ca/index.html>
--- End Message ---
--- Begin Message ---
Try str_replace.

$string = "whatever";
$invalidChars = array("(", ")", "\\", "\"", "'"); //put whatever characters here
trim(str_replace($invalidChars, "",$string))

----- Original Message ----- From: "Derek C Hopkins" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Wednesday, January 31, 2007 1:10 PM
Subject: [PHP-WIN] using preg_replace or equivelent


Hi All

Not knowing cgi-script I am having trouble understanding the preg_replace function in PHP.

What I want to do is remove all ocurances of the following items from a string

All spaces, open brackets, close brackets, apostriphy, and period (full stop)

        from a string  such as these

Audlin,Mary Ann,Spalding,14,412
Audsley,David.,Leeds,23,354
Audsley,David (Male),Leeds,23,354
Audsley,David O'Shannesey,Leeds,23,354

My thoughts were the following code

But it does not work

# need to remove punctuation in forname, ( . ) ZZZZZZZZZZZZZZZZZZZZZZZZZZZZ $patterns[0] = '/./'; $pattern[1] = '/(/'; $pattern[2] = '/)/'; $pattern[3] = "'"; $pattern[4] = '/ /'; $replacements[0] = "-"; $replaements[1] = "2"; $replacements[2] = "3"; $replaements[3] = "4";
 $forname = preg_replace($patterns,$replacements ,$forname);
 $surname = preg_replace($patterns,$replacements ,$surname);

What happens is all characters get changed to - (the first 0 replacement.

Any help with this or another solution would be appreciated.



Cheers Derek

Derek C Hopkins,                     Phone    +1(450)678-7768
6640, Biarritz,                          Fax      +1(450)678-4252
Brossard, E-Mail [EMAIL PROTECTED]
QC,  Canada,  J4Z-2A2.

==== FreeBMD - England and Wales - Birth - Marriage and Death Transcriptions
<http://FreeBMD.rootsweb.com>

==== Check out FreeBMD Scan2 Syndicate page (revised daily)
Please bookmark our new home http://www.scan2.ca/scan2.html

==== Check out QFHS Marriage Transcription Project page (revised daily)
(Quebec Family History Society)
Please bookmark our new home http://www.scan2.ca/qfhs.html

Check out my web page (22jan1997) Last Revised 28 May 1998
<http://www.cam.org/~hopkde/index.html>

Check out Abney Park Indexing Project (revised 14 MAR 2000, 195,000 names)
<http://www.cam.org/~hopkde/abney.html>

Check out my web Ramsgate page
<http://members.adept.co.uk/hopkde>

Check out the Quebec Family History web page
<http://www.qfhs.ca/index.html>
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




--- End Message ---
--- Begin Message ---
Hi Terry

Program now working like a charm. Your solution was what the doctor ordered. THANK'S

At 02:15 PM 31/01/2007, Phillip Terry wrote:
Try str_replace.

$string = "whatever";
$invalidChars = array("(", ")", "\\", "\"", "'"); //put whatever characters here
trim(str_replace($invalidChars, "",$string))

----- Original Message ----- From: "Derek C Hopkins" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Wednesday, January 31, 2007 1:10 PM
Subject: [PHP-WIN] using preg_replace or equivelent


Hi All

Not knowing cgi-script I am having trouble understanding the preg_replace function in PHP.

What I want to do is remove all ocurances of the following items from a string

All spaces, open brackets, close brackets, apostriphy, and period (full stop)

        from a string  such as these

Audlin,Mary Ann,Spalding,14,412
Audsley,David.,Leeds,23,354
Audsley,David (Male),Leeds,23,354
Audsley,David O'Shannesey,Leeds,23,354

My thoughts were the following code

But it does not work

# need to remove punctuation in forname, ( . ) ZZZZZZZZZZZZZZZZZZZZZZZZZZZZ $patterns[0] = '/./'; $pattern[1] = '/(/'; $pattern[2] = '/)/'; $pattern[3] = "'"; $pattern[4] = '/ /'; $replacements[0] = "-"; $replaements[1] = "2"; $replacements[2] = "3"; $replaements[3] = "4";
 $forname = preg_replace($patterns,$replacements ,$forname);
 $surname = preg_replace($patterns,$replacements ,$surname);

What happens is all characters get changed to  -   (the first 0 replacement.

Any help with this or another solution would be appreciated.



Cheers Derek

Derek C Hopkins,                     Phone    +1(450)678-7768
6640, Biarritz,                          Fax      +1(450)678-4252
Brossard,                                E-Mail [EMAIL PROTECTED]
QC,  Canada,  J4Z-2A2.

==== FreeBMD - England and Wales - Birth - Marriage and Death Transcriptions
<http://FreeBMD.rootsweb.com>

==== Check out FreeBMD Scan2 Syndicate page (revised daily)
Please bookmark our new home http://www.scan2.ca/scan2.html

==== Check out QFHS Marriage Transcription Project page (revised daily)
(Quebec Family History Society)
Please bookmark our new home http://www.scan2.ca/qfhs.html

Check out my web page (22jan1997) Last Revised 28 May 1998
<http://www.cam.org/~hopkde/index.html>

Check out Abney Park Indexing Project (revised 14 MAR 2000, 195,000 names)
<http://www.cam.org/~hopkde/abney.html>

Check out my web Ramsgate page
<http://members.adept.co.uk/hopkde>

Check out the Quebec Family History web page
<http://www.qfhs.ca/index.html>
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Cheers Derek

Derek C Hopkins,                     Phone    +1(450)678-7768
6640, Biarritz,                          Fax      +1(450)678-4252
Brossard,                                E-Mail   [EMAIL PROTECTED]
QC,  Canada,  J4Z-2A2.

==== FreeBMD - England and Wales - Birth - Marriage and Death Transcriptions
<http://FreeBMD.rootsweb.com>

==== Check out FreeBMD Scan2 Syndicate page (revised daily)
Please bookmark our new home http://www.scan2.ca/scan2.html

==== Check out QFHS Marriage Transcription Project page (revised daily)
(Quebec Family History Society)
Please bookmark our new home http://www.scan2.ca/qfhs.html

Check out my web page (22jan1997) Last Revised 28 May 1998
<http://www.cam.org/~hopkde/index.html>

Check out Abney Park Indexing Project (revised 14 MAR 2000, 195,000 names)
<http://www.cam.org/~hopkde/abney.html>

Check out my web Ramsgate page
<http://members.adept.co.uk/hopkde>

Check out the Quebec Family History web page
<http://www.qfhs.ca/index.html>
--- End Message ---
--- Begin Message ---
I've been looking at Eclipse as my PHP dev tool. I've installed the PHP
Development Tools and Aptana plugins. So far, I like the tool. Outside
of it eating up my memory at times, it's a nice IDE. Anyone have any
experience with Eclipse and any other PHP plugins? Do you like, not
like?
 
Bill Bolte, Web Developer
High Touch, Inc.
hightouchinc.com

 

--- End Message ---
--- Begin Message --- I seem to remember that there was a simple call to get reference to the the screen previous to where the client currently is. Please remind me how this is done?
I need to place a Back button on my clients screens.
--
Regards,
Alf Stockton            www.stockton.co.za

You will be married within a year, and divorced within two.
My email disclaimer is available at www.stockton.co.za/disclaimer.html

--- End Message ---

Reply via email to