| | |
replace string
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
Simple PHP should do it if you do not know regular expressions.
PHP Syntax (Toggle Plain Text)
$string = "abcd123xyz"; if((substr($string,0,3)=="abc") && (substr($string,-3)=="xyz")) { $string = "this is a test"; } echo $string;
![]() |
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
| Thread Tools | Search this Thread |
.htaccess ajax apache api array beginner binary broken buttons cakephp checkbox class cms code cron curl database date directory display dynamic ebooks echo email error file files folder form forms function functions google href htaccess html image include insert integration ip java javascript joomla limit link login loop mail mediawiki menu mlm mod_rewrite multiple mysql number oop paypal pdf php phpincludeissue phpmyadmin problem query radio random recursion regex remote script search server sessions sms soap source sp space speed sql subdomain syntax system table tag tutorial update upload url validation validator variable vbulletin video web webdesign websphere white xml youtube





