javascript - how to split the value in database using explode function in php -
i have column in db contains set of sentence separated ';' want extract value , print 2 statement in 2 different div's.
for example
this cow;it gives milk output should be
this cow gives milk
you explode , foreach up
<?php $str='this cow;it gives milk'; foreach(explode(';',$str) $k=>$v) { echo "<div id=div$k>$v</div>"; } output :
<div id=div0>this cow</div> <div id=div1>it gives milk</div>
Comments
Post a Comment