Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8715273
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T05:48:26+00:00 2026-06-13T05:48:26+00:00

<? php $Src = ‘images/pages/clients/logos/clnt_aljareera_img.jpg’; $pttn= ‘/&Src:’.$Src.’/’; $string=preg_replace($pttn,”,$string,1); ?> //output Error: Unknown modifier ‘p’

  • 0
<? php
    $Src = 'images/pages/clients/logos/clnt_aljareera_img.jpg';
    $pttn= '/&Src:'.$Src.'/';
    $string=preg_replace($pttn,'',$string,1);
?>

//output Error: Unknown modifier ‘p’ in

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T05:48:27+00:00Added an answer on June 13, 2026 at 5:48 am

    Your string contains a whole mess of / which would need to be escaped as \/ when using / as the regex delimiter. Instead of / as the regex delimiters, use something which won’t occur in your string like ~ for example. You must choose a delimiting character which is guaranteed not to appear in $Src, however. You might be safer even with | than with ~.

    $Src = 'images/pages/clients/logos/clnt_aljareera_img.jpg';
    // Delimit the regular expression with ~
    $pttn= '~&Src:'.$Src.'~';
    $string=preg_replace($pttn,'',$string,1);
    

    What has happened is your regex delimited by / encounters a p immediately after images/ because it thinks it has reached the closing delimiter. The next word pages is mistakenly treated as a string of regex modifiers.

    PHP sees the regular expression:

    /&src:images/pages
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a javascript function generateGraph() { ... jQuery.get('chart.php?month='+month+'&year='+year); document.getElementById('graph').src = 'charts/'+month+'_'+year+'.png'; ... }
I have the following string: $/Mycollection/Branches/Dev/New/php/MySite/src/MySite/somefolder/src/sad.php I need to create regex pattern and take
$('#test-list').append($(document.createElement(li)).attr({id: data.msg})); $('#'+data.msg).append($(document.createElement(img)).attr({src: kep.php?kep=upload/+data.msg+&w=180;&h=150;})); Does not work, because of the $('#'+data.msg). param. I don't
I'm trying to make a simple php script to find all src attributes from
I have the following codes <div class=row-fluid> <div class=span6><img src = <?php echo $photo
This topic is a remark for PHP get image src So we have a
When I processed the following file src.php : <?php include params.php; ?> Str 1
My application file: <?php // /src/app.php require_once __DIR__ . '/../lib/vendor/Sensio/silex.phar'; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response;
I am trying to make a small facebook application with php & facebook PHP
// src/Acme/DemoBundle/Tests/Controller/DemoControllerTest.php namespace Acme\DemoBundle\Tests\Controller; use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; class DemoControllerTest extends WebTestCase { public function testIndex()

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.