dennismonsewicz Posted October 28, 2008 Share Posted October 28, 2008 I have this array: $myArr=array("<b>Id</b>","<b>Project</b>","<b>Project Id</b>","<b>PM</b>","<b>Designer</b>","<b>PM</b>","<b>Writer</b>","<b>PM</b>","<b>Designer</b>","<b>PM</b>","<b>Christine</b>","<b>PM</b>","<b>Designer</b>", "<b>PM</b>","<b>Julie</b>","<b>PM</b>","<b>Designer</b>","<b>PM</b>","<b>Proofreading</b>","<b>PM</b>","<b>Layne</b>","<b>PM</b>","<b>Programming</b>","<b>PM</b>","<b>Testing</b>"); How do i go about going through each item in the array and making it bold without having to place the <b></b> tags in the array? Quote Link to comment Share on other sites More sharing options...
rhodesa Posted October 28, 2008 Share Posted October 28, 2008 i'm confused? the <b> tags ARE in the array already? Quote Link to comment Share on other sites More sharing options...
.josh Posted October 28, 2008 Share Posted October 28, 2008 assuming you want to remove the bold tags... $array = array('a','b','c'); foreach($array as $val) { echo "<b>$val</b>"; } Quote Link to comment Share on other sites More sharing options...
GKWelding Posted October 28, 2008 Share Posted October 28, 2008 <?php $array=array("Id","Project","Project Id"); foreach($array as $value){ $display .= "<b>".$value."</b>"; //optionally add a <br> after </b> to get them on a new line } echo $display; ?> 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.