•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 455,970 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,773 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 820 | Replies: 3
![]() |
•
•
Join Date: Aug 2007
Location: Cavite,Philippines
Posts: 508
Reputation:
Rep Power: 3
Solved Threads: 68
•
•
Join Date: Aug 2005
Location: somewhere in time
Posts: 81
Reputation:
Rep Power: 4
Solved Threads: 5
Simple PHP should do it if you do not know regular expressions.
$string = "abcd123xyz";
if((substr($string,0,3)=="abc") && (substr($string,-3)=="xyz"))
{
$string = "this is a test";
}
echo $string;![]() |
•
•
•
•
•
•
•
•
DaniWeb PHP Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Similar Threads
- Replace String (JSP)
- How to Remove Newline character from a VB String (Visual Basic 4 / 5 / 6)
- String replacement in a file (Perl)
- Howto | mssql seach and replace? (MS SQL)
- search and replace (Java)
- Problem with String replaceAll method (Java)
- Conver int Array into a String (Java)
Other Threads in the PHP Forum
- Previous Thread: Help with php and dreamweaver requested
- Next Thread: PHP blog from flat file


Linear Mode