[PHP] String Issue

2008-01-23 Thread Johny Burns
I have the following string on the address line

HTMLFiles/MenuDisplay.php?var=Thai%20ImageItem=1797Action=add

I am trying to delete or replace the 'Item=1797Action=add' (it is at the 
end of the string)

I am not familiar as much with those string functions, and if somebody can 
give me some suggestions. I will appreciated it.

Thank you in advance. 

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



Re: [PHP] String Issue

2008-01-23 Thread Robert Cummings

On Wed, 2008-01-23 at 23:30 -0600, Johny Burns wrote:
 I have the following string on the address line
 
 HTMLFiles/MenuDisplay.php?var=Thai%20ImageItem=1797Action=add
 
 I am trying to delete or replace the 'Item=1797Action=add' (it is at the 
 end of the string)
 
 I am not familiar as much with those string functions, and if somebody can 
 give me some suggestions. I will appreciated it.
 
 Thank you in advance. 

You want the following functions:

http://www.php.net/manual/en/function.parse-url.php
http://www.php.net/manual/en/function.parse-str.php

Cheers,
Rob.
-- 
...
SwarmBuy.com - http://www.swarmbuy.com

Leveraging the buying power of the masses!
...

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



Re: [PHP] String Issue

2008-01-23 Thread venkatk

 Hi,

Try this:

$str = 'HTMLFiles/MenuDisplay.php?var=Thai%20ImageItem=1797Action=add';
$str = preg_replace(/(\Item.*)$/,REPLACEMENT STRING, $str);

this should work.

Cheers,
V


 


 

-Original Message-
From: Johny Burns [EMAIL PROTECTED]
To: php-general@lists.php.net
Sent: Thu, 24 Jan 2008 11:00 am
Subject: [PHP] String Issue










I have the following string on the address line

HTMLFiles/MenuDisplay.php?var=Thai%20ImageItem=1797Action=add

I am trying to delete or replace the 'Item=1797Action=add' (it is at the 
end of the string)

I am not familiar as much with those string functions, and if somebody can 
give me some suggestions. I will appreciated it.

Thank you in advance. 

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




 



You are invited to Get a Free AOL Email ID. - http://webmail.aol.in