| | |
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
Views: 1351 | Replies: 3
| Thread Tools | Search this Thread |
Tag cloud for PHP
.htaccess access activation ajax apache api array beginner binary broken cakephp checkbox class cms code cron curl database date directory display download dynamic echo email error file files folder form forms function functions google href htaccess html image include insert integration ip java javascript joomla jquery limit link login loop mail menu methods mlm mod_rewrite multiple mysql oop parse paypal pdf php problem procedure query radio ram random recursion regex remote script search select server sessions smash sms soap source space speed sql structure syntax system table tutorial update updates upload url validation validator variable video web websitecontactform xml youtube





