Jump to content

simple ereg_replace help


belick

Recommended Posts

Also this way mate all throw all the table ok.


<?
//just chage $b=explode("",tablename);

$b=array("dbo.Table1.Field1"
,"dbo.Table2.Field2"
,"dbo.Table3.Field3"
,"dbo.Table4.Field4");

while(list($k,$v)=each($b)) {

$x=substr($v, 11);

echo "<br>$x";
}


?>

//out come

Field1
Field2
Field3
Field4
right, but the string is not somthing with "table" only it can be "dbo.(*.*).Field3".

$string = 'dbo.Table3.Field3';
$pattern = '/^dbo\.Table\d+\./';
$replacement = '';
echo preg_replace($pattern, $replacement, $string);

bottom line, I need to get rid of anything before the field name.

Thanks

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.