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 6548143
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T11:54:56+00:00 2026-05-25T11:54:56+00:00

I use preg_replace in my Bbcode parse function. I have an array of simple

  • 0

I use preg_replace in my Bbcode parse function. I have an array of simple search strings using regex and an array of simple replace strings. (About 15 lengthy strings each.)

This function is being used very frequently. Could this be the cause of my recent 502s?

I’ve made a few changes and this is one of them. I’m trying to locate the problem.

Thanks.

  • 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-05-25T11:54:56+00:00Added an answer on May 25, 2026 at 11:54 am

    I would recommend profiling your application with xdebug. It’s a free extension to php which will show you exactly which functions/portions of code are causing the slow execution.

    However, test it on a local server, because xdebug is very heavy and will slow down your application if used on a production server.

    You can examine xDebug’s output files with Webgrind – http://code.google.com/p/webgrind/

    And to answer your question exactly – I don’t believe preg_replace will cause your script to become this heavy.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can you use two regex in preg_replace to match and replace items in an
I'm using preg_replace to create urls for modrewrite based paging links. I use: $nextURL
In the documentation for preg_replace it says you can use indexed arrays to replace
I'm trying to use preg_replace to replace &lt;a href=&quot;WWW.ANYURL.COM&quot;&gt;DISPLAY_TEXT&lt;/a&gt; with <a href=WWW.ANYURL.COM>DISPLAY_TEXT</a> here is
I have well-formed xml documents into string variables. I want to use preg_replace to
I can't quite figure out the right pattern to use with PHP's preg_replace function.
Is there any reason why I can't use preg_replace inside a static function? when
How can I use preg_replace to do this: I want to replace: <a href=index.php?option=example1&view=something>
I have a little problem with preg_replace . I need a function that removes
I am trying to search and replace special characters in strings that I am

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.