Hi I have a data april/2010 to jan/2011 Is there any way to split the data with character to and select the date as The value before "to" as FROM and The Value after "to" as TO how to selet the splited value......... while i am selecting the data as it is as select date from mytbl how to select the date as two values
+1
A:
If you have your data in a string, like this :
$str = 'april/2010 to jan/2011';
You can use the explode
function to get the two parts :
list ($from, $to) = explode(' to ', $str);
Then, just to be sure, if we echo them :
echo "From : $from<br />";
echo "To : $to<br />";
We get :
From : april/2010
To : jan/2011
Pascal MARTIN
2010-04-03 11:12:18
@pascal Martin Thanks for your effort ....But This is like getting the result and then spliting data i am looking for a method which splits the data in the query itselflike < select date as from,date as To
udaya
2010-04-03 11:18:12