Skip navigation
Currently Being Moderated

convert eregi to php 5.3 compliance

Apr 5, 2010 10:05 AM

ereg / eregi is no longer supported in 5.3+

 

need some help converting this.

 

 

<?php

$path = $_SERVER['REQUEST_URI'];

if(eregi('^/community/',$path) == 1) {

?>

 
Replies
  • Currently Being Moderated
    Apr 5, 2010 1:06 PM   in reply to jsteinmann

    Have you tried preg_match with the i modifier ?

     

    HTH

     

    -Rob B

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 7, 2010 8:17 AM   in reply to jsteinmann

    jsteinmann wrote:

     

     

    ereg / eregi is no longer supported in 5.3+

    No, it's deprecated, which means it still works, but will be removed from the next major version.

    if(eregi('^/community/',$path) == 1) {
    if (preg_match('#^/community/#i', $path)) {
    
     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points