belick Posted July 24, 2006 Share Posted July 24, 2006 I need to fetch part of a string that can be anyting. The roll is basic:starting with " dbo." ending with ".(.*) " I thinkbotom line I need to fetch: "dbo.AnyTableHere.AnyField" when "AnyTableHere" can be anything etc...(CASE WHEN dbo.AnyTableHere.AnyField = 1 THEN dbo.T_Trucks.TruckName END)thanks ahead!!! Quote Link to comment Share on other sites More sharing options...
effigy Posted July 24, 2006 Share Posted July 24, 2006 [code]<?php $string = '(CASE WHEN dbo.AnyTableHere.AnyField = 1 THEN dbo.T_Trucks.TruckName END)'; preg_match_all('/dbo\.(.+?)\./', $string, $matches); array_shift($matches); echo '<pre>', print_r($matches, true), '</pre>';?>[/code] Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.