I am trying to use preg_replace function to parse this table in a Html page :
Tuition. $13,140 $13,167 $13,167
Books $996 $1,176 $1,176
Because of table tags I got "Unknown modifier 't' " error and I changed '/ /' with '~ ~'.
Still I have problem, the function is not changing the text. I think the problem with '$' dollars sign in the text, how can I skip it? I tried to do but I couldn't.
Here is my code :
$price = $html->find('div[id=divctl00_cphCollegeNavBody_ucInstitutionMain_ctl00] table[class=tabular]');
$price1=$price[0];
$show=$price1;
$ch="~".$show->children(1)->children(0)->children(1)."~";
$show=preg_replace($ch,' ',$show, 1);
Thanks
preg_quotewill escape the pattern so thepreg_replaceworks, but I'm not sure what you're actually trying to do with the table?$ch