Solved

Remove everything between <[ and ]>

Posted on 2008-10-22
3
187 Views
Last Modified: 2008-10-22
I want to remove all instances of everything between <[ and ]>

This is a variation of this solution:
http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/PHP/Q_23837938.html
0
Comment
Question by:hankknight
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 35

Accepted Solution

by:
Terry Woods earned 500 total points
ID: 22780386
Try this
echo preg_replace( '#<\[.*?\]>#','', $str);

Open in new window

0
 
LVL 16

Author Comment

by:hankknight
ID: 22780569
0
 
LVL 82

Expert Comment

by:hielo
ID: 22780632
try:
echo preg_replace( '#<\[[^\]]*\]>#','', $str);

Open in new window

0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Generating table dynamically is the most common issue faced by php developers.... So it seems there is a need of an article that explains the basic concept of generating tables dynamically. It just requires a basic knowledge of html and little maths…
Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question