SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Threaded View

  1. #1
    SitePoint Member
    Join Date
    Oct 2013
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Warning: preg_replace(): No ending delimiter '~' found

    I get a warning on index.php page....

    Warning: preg_replace(): No ending delimiter '~' found in C:\xampp\htdocs\index.php on line 107

    PHP Code:
    /*
    *
    *
    */
    function parse_uri( )
    {
        
    // Removes any subfolders in which the app is installed
        
    $real_uri preg_replace('~^'.APP_FOLDER.'~'''$_SERVER['REQUEST_URI'], 1);

        
    $uri_array explode('/'$real_uri);

        
    // If the first element is empty, get rid of it
        
    if (empty($uri_array[0])) {
            
    array_shift($uri_array);
        }

        
    // If the last element is empty, get rid of it
        
    if (empty($uri_array[count($uri_array)-1])) {
            
    array_pop($uri_array);
        }

        return 
    $uri_array;


    Have googled and looked at PHP manual online?

    The regular expression has an ending delimiter, '~'

    So not sure?

    Thanks
    Last edited by ScallioXTX; Oct 15, 2013 at 13:45. Reason: Wrapped code in [php][/php]


Bookmarks

Posting Permissions

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