Solved

Remove everything between <[ and ]>

Posted on 2008-10-22
3
184 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
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
php date - compare 4 40
what is best version of php to use 6 46
updating the date data 12 25
How can I echo a PHP variable in AJAX function? 7 35
Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

867 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now