Regular expressions

SpaceshipSpaceship
Watch

SiKing

Registered MemberEstablished Member
Impact
6
Hey. Just writing a script in PHP but come accross a problem. I am unsure of how to use eregi_replace to remove "<object value='could-be-anthing'".

At the moment, I have:

PHP:
$str2 = eregi_replace("\<option value='[[:alpha:]]' \>", "", stripslashes($str1));

..but no worky. Any help is appreciated as always.

Thanks
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
AfternicAfternic
Use preg.
PHP:
<?php

$str2 = preg_replace("#<option value='.*?'>#i", '', stripslashes($str1));

?>
 
1
•••
Thanks very much! Tried to leave rep but it says I've already given you rep before. Thanks again :)
 
0
•••
No problem :)
 
0
•••
SecondVersion said:
No problem :)
It will never cease to amaze me how much you know about PHP 2ndV lol.
Rep left.
 
0
•••
Dynadot — .com TransferDynadot — .com Transfer
Appraise.net

We're social

Escrow.com
Spaceship
Rexus Domain
CryptoExchange.com
Domain Recover
CatchDoms
DomDB
NameFit
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back