Solved

Remove everything between <[ and ]>

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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Suggested Solutions

Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
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…
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.

770 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