Replacing

Author Topic: Replacing  (Read 686 times)

Offline chinmay.sahooTopic starter

  • Trade Count: (0)
  • Full Member
  • ***
  • Thank You 2
  • Posts: 158
  • Karma: 0
    • Hot Shaper
Replacing
« on: 01-14-2017, 06:27:09 »
The ereg_replace( ) function takes a pattern, a replacement string, and a string in which to search. It returns a copy of the search string, with text that matched the pattern replaced with the replacement string:

Code:
Only registered users can see contents. Please click here to Register or Login.
If the pattern has any grouped subpatterns, the matches are accessible by putting the characters \1 through \9 in the replacement string. For example, we can use ereg_replace( ) to replace characters wrapped with and tags with equivalent HTML tags:

Code:
Only registered users can see contents. Please click here to Register or Login.

The eregi_replace( ) function is a case-insensitive form of ereg_replace( ). Its arguments and return values are the same as those for ereg_replace( ).


 

Related Topics

  Subject / Started by Replies Last post
3 Replies
1928 Views
Last post 05-08-2010, 15:28:38
by PCKen
0 Replies
950 Views
Last post 11-04-2011, 03:50:47
by manvbf
0 Replies
961 Views
Last post 12-26-2012, 02:27:00
by rosemarie