Sid04 Posted December 15, 2005 Share Posted December 15, 2005 These are for an info box. Both sections of code work fine...just curious if one is prefered over the other...?? Example 1: <?php $info_box_contents = array(); $info_box_contents[] = array('align' => 'left', 'text' => MY_TEXT ); new infoBoxHeading($info_box_contents, false, false); $info_box_contents = array(); $info_box_contents[] = array('align' => 'center', 'text' => tep_image(DIR_WS_IMAGES . 'image.gif') ); new infoBox($info_box_contents); ?> Second Example: <?php { $info_box_contents = array(); $info_box_contents[] = array('align' => 'left', 'text' => MY_TEXT ); new infoBoxHeading($info_box_contents, false, false); $info_box_contents = array(); $content='<center><img src="images/image.gif"></center>'; $content.= ''; $info_box_contents[] = array('text' => $content); new infoBox($info_box_contents); } ?> Both do the same thing for me....is one better then the other to use for any reason? Thanks! Link to comment Share on other sites More sharing options...
Jack_mcs Posted December 15, 2005 Share Posted December 15, 2005 Functionally, they are the same. The second one works better if there are a lot of additions to the string in the code. Otherwise, it just increase the complexity of the code and should not be used. Jack Support Links: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. All of My Addons Get the latest versions of my addons Recommended SEO Addons Link to comment Share on other sites More sharing options...
Sid04 Posted December 15, 2005 Author Share Posted December 15, 2005 Thank you! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.