开发者

Giving space in a word

I've a table contain 2 fields DATEFROM & DATETO. Now i fetch dis names from table and display the same, but i want to display like DATE FROM & DATE TO...If it is this possible How? We have any functions li开发者_如何学运维ke 'explode()'? please help


If it is only used on those fields then you could use

str_replace('DATE', 'DATE ', $dateField);

But in that situation there is no way to determine where a word starts/ends otherwise.

If the field names were camel case or separated with underscores then it would be different.


You can use substring() to extract content from fields, if you want to name column differently, use as, e.g. select datefrom as [date from] from mytable.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜