Tutorials Point


  Learning PHP
  Advanced PHP
  PHP Function Reference
  PHP Useful Resources
  Selected Reading

Copyright © 2014 by tutorialspoint



  Home     References     Discussion Forums     About TP  

PHP Function eregi_replace()

previous

Advertisements

Syntax

string eregi_replace (string pattern, string replacement, string originalstring);

Definition and Usage

The eregi_replace() function operates exactly like ereg_replace(), except that the search for pattern in string is not case sensitive.

Return Value

  • After the replacement has occurred, the modified string will be returned.

  • If no matches are found, the string will remain unchanged.

Example

Following is the piece of code, copy and paste this code into a file and verify the result.

<?php

$copy_date = "Copyright 2000";
$copy_date = eregi_replace("([a-z]+)", "&Copy;", $copy_date);
print $copy_date;

?>

This will produce following result

© 2000


previous Printer Friendly

Advertisements


  

Advertisements