php - How to add the html tag into codeigniter variable? -


i using following code display table row

$tablerow="<tr>            <td style='text-align:center'>".$services[$i]['servicename']."</td>            <td style='text-align:center'>".$services[$i]['servicedesc']."</td>            <td style='text-align:right'>".$services[$i]['taxamt']."</td>            </tr>"; 

but value display.i got following out

test tset 43500 

i want these

<tr> <td style='text-align:center'>test</td> <td style='text-align:center'>tset</td> <td style='text-align:right'>43500</td> </tr> 

you can use php function display value

$tablerow="<tr>                 <td style='text-align:center'>".$services[$i]['servicename']."</td>                 <td style='text-align:center'>".$services[$i]['servicedesc']."</td>                 <td style='text-align:right'>".$services[$i]['taxamt']."</td>                 </tr>"; 

echo htmlentities($tablerow);


Comments

Popular posts from this blog

angular - Is it possible to get native element for formControl? -

unity3d - Rotate an object to face an opposite direction -

javascript - Why jQuery Select box change event is now working? -