Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
0

convert eregi to php 5.3 compliance

Guest
Apr 05, 2010 Apr 05, 2010

Copy link to clipboard

Copied

ereg / eregi is no longer supported in 5.3+

need some help converting this.

<?php

$path = $_SERVER['REQUEST_URI'];

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

?>

TOPICS
Server side applications

Views

730
Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Apr 07, 2010 Apr 07, 2010

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)) {

Votes

Translate
Explorer ,
Apr 05, 2010 Apr 05, 2010

Copy link to clipboard

Copied

Have you tried preg_match with the i modifier ?

HTH

-Rob B

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 07, 2010 Apr 07, 2010

Copy link to clipboard

Copied

LATEST

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)) {

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines