|
|
Joined: Apr 2003
Posts: 2
Lurker
|
Lurker
Joined: Apr 2003
Posts: 2 |
I would like to find part a string and then be able to delete it. For example if i had the string "This is a string" I would like to delete the word "is" HOw would i do this, and retani the rest of the string, so that i end up with "This a string" This will need to be done for many different strings, so i cannot simply use strlen() functions to return a specific lenght of the string.
|
|
|
|
Joined: Apr 2002
Posts: 1,768
Addict
|
Addict
Joined: Apr 2002
Posts: 1,768 |
$s1 = 'This is a string'; For that particular example, a couple of methods could be used: $s2 = str_replace(' is ', ' ', $s1); $s2 = preg_replace('/ is /', ' ', $s1);
|
|
|
|
Joined: Apr 2003
Posts: 2
Lurker
|
Lurker
Joined: Apr 2003
Posts: 2 |
Thank you very much....just neede that to give the fnishing touches to the control panel of my website. 
|
|
|
Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.
Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
|
|
Posts: 69
Joined: January 2001
|
|
Forums63
Topics37,575
Posts293,932
Members13,824
|
Most Online6,139 Sep 21st, 2024
|
|
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
|
|
|
|
|