Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Sep 2012
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Deprecated: Function eregi() is deprecated in

    I have exhausted my search and with very limited knowledge in PHP I am asking for anyone's help fixing my !eregi problem. Here is the code I need to fix:

    if ( eregi( 'index.php\?', $row->link ) ) {
    if ( !eregi( 'Itemid=', $row->link ) ) {
    $row->link .= '&Itemid='. $row->id;
    }
    }
    If there is anything else you need from me please let me know.

    Thanks!

  • #2
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,978
    Thanks
    4
    Thanked 2,659 Times in 2,628 Posts
    Simply replace it with preg instead.
    PHP Code:
    if (preg_match('#index.php\?#'$row->link) && !preg_match('#Itemid=#'$row->link))
    {
        
    $row->link .= '&Itemid=' $row->id;

    Although given the purpose, you may want to avoid preg completely and look at using http_build_query with an array.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •