Jump to content

The easiet possible way...


jzimmerlin

Recommended Posts

For future reference, take a look at http://www.php.net first. A little effort before asking questions is always appreciated.

Now...I basically did it for you here:

[code]<?php

  $string = '01234567890abcd[ignorethis]blahblahblah';

  preg_match('/[a-z0-9]+(\[[a-z0-9]+\])[a-z0-9]+/',$string,$matches);
 
  $cleantxt = str_replace($matches[1],'',$matches);
  $ignoredtxt = $matches[1];
 
  echo"$cleantxt[0]";
  // 01234567890abcdblahblahblah

?> [/code]

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.