Some problem with regex

Posted by gjoshi on Stack Overflow See other posts from Stack Overflow or by gjoshi
Published on 2010-06-17T09:33:45Z Indexed on 2010/06/17 10:13 UTC
Read the original article Hit count: 345

Filed under:
|

hello all in my site users can insert data using tabular format. that table can be of any style. but im using regex to give those tables a standard format of our site.but when im using regex it works well but it is removing colspan. but i need colspan widout it tables looks very odd. will anyone please tell me wats wrong with my regex?? following is my regex codes:

$table=eregi_replace("<table[^>]*>","<table  width='100%' border='0' cellspacing='0' cellpadding='0' class='tabularData'>", $table);
$table= preg_replace('/style\s*=\s*(\'|").+(\'|")/i', '', $table);
$table= preg_replace('/bgcolor\s*=\s*(\'|").+(\'|")/i', '', $table);
$table=eregi_replace("<span[^>]*>","",$table);

thanks in advance :)

© Stack Overflow or respective owner

Related posts about php

Related posts about regex