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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T07:20:06+00:00 2026-05-15T07:20:06+00:00

similiar like this example, php: remove brackets/contents from a string? i have no idea

  • 0

similiar like this example, php: remove brackets/contents from a string? i have no idea to replace

$str = '(ABC)some text'

into

$str = 'ABC';

currently use $str = preg_replace('/(.)/','',$str); but not works. how to fix this?

  • 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-15T07:20:07+00:00Added an answer on May 15, 2026 at 7:20 am

    If you want to use replace, you could use the following:

     $str = "(ABC)some text";
     $str = preg_replace("/^.*\(([^)]*)\).*$/", '$1', $str);
    

    The pattern will match the whole string, and replace it with whatever it found inside the parenthesis

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

Sidebar

Ask A Question

Stats

  • Questions 506k
  • Answers 506k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer If most cases are best handled by calling cls, and… May 16, 2026 at 3:49 pm
  • Editorial Team
    Editorial Team added an answer It increments preempt_count() - notice the () - which is… May 16, 2026 at 3:49 pm
  • Editorial Team
    Editorial Team added an answer Simple array with emails <?php $programs = array( "Red Program"… May 16, 2026 at 3:49 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

In scripting languages like PHP having a for loop like this would be a
This is mainly a performance questions. I have a master list of all users
I am looking for some help. I have found this script that sort of
This is going to be very simple I know. I have seen so many
I want to parse (in a special way) a CSS file with PHP. Example:
I'm working with a XML structure that looks like this: <ROOT> <ELEM_A> <A_DATE>20100825</A_DATE> <A_TIME>141500</A_TIME>
I am wanting to add a section in my php application to add /
I Would like the get the filesize of a remote file using Rebol, in
I'm wanting to do something similar to this: Matching an IP to a CIDR
Similar questions: Some characters in CSV file are not read during PHP fgetcsv() ,

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.