jrp91384 Posted October 30, 2009 Share Posted October 30, 2009 Hello, Could someone please tell me how to add an image within my list items? I don't know how to code the file path within a function. Any help is greatly appreciated!!! Thank you function vis_page_overview() { echo ' <div class="wrap"> <p id="icon-edit" class="icon32"><h2>xxx Center Overview</h2></p> <p>Below you will find instructions on how to perform common tasks that are specific to your site.</p> <div id="vis-box-1" class="vis-boxes"> <div class="box-heading">Quick Links - General</div> <ul> <li><a href="?page=definitions">Definitions</a></li> <li><a href="?page=pages#edit-page">Edit - Page</a></li> <li><a href="?page=pages#add-page">Add - Page</a></li> Quote Link to comment Share on other sites More sharing options...
MadTechie Posted October 30, 2009 Share Posted October 30, 2009 its the same a any HTML (moving to HTML Help) <IMG src="path/to/image.jpg"> Quote Link to comment Share on other sites More sharing options...
jrp91384 Posted October 30, 2009 Author Share Posted October 30, 2009 The problem with using conventional html is the quotes within the function. How do I add it within a function output? Quote Link to comment Share on other sites More sharing options...
MadTechie Posted October 30, 2009 Share Posted October 30, 2009 Okay.. Here are some examples $Var = "Testing<BR />\n" echo "1 here is a quote \" and a single quote ' $Var"; echo '2 here is a quote " and a single quote \' $Var'; echo '3 here is a quote " and a single quote \' '.$Var; 1 = this uses double quotes thus i escape the double quotes inside (\") 2 = this uses single quotes thus i escape the single quotes inside (\') BUT notice that $Var doesn't get parsed, this is because variable don't get parsed inside single quotes 3 = same as 2 BUT i moved $Var outside the quotes by concatenation (the dot . joins then) I Hope that helps Quote Link to comment Share on other sites More sharing options...
haku Posted October 30, 2009 Share Posted October 30, 2009 I personally prefer method three for two reasons: 1) Using single quotes and concatenating variables processes faster than using double quotes and including variables. 2) It is easy to miss variables that are included in strings when you go back and look at code. This can make debugging difficult. Quote Link to comment Share on other sites More sharing options...
MadTechie Posted October 30, 2009 Share Posted October 30, 2009 Humm.. I mainly use 1 more than 3.. But I guess its what you used to.. I use them all , it depends on the case.. i don't think speed is much of an issue since the release of PHP5, Quote Link to comment Share on other sites More sharing options...
haku Posted October 30, 2009 Share Posted October 30, 2009 It's not really. We are talking microseconds! But, I'm still a purest that way - old habits die hard! That being said, I think my second argument towards it was the main reason I prefer to concatenate variables - I just find it easier to debug code. But, they all work fine. Quote Link to comment Share on other sites More sharing options...
jrp91384 Posted October 30, 2009 Author Share Posted October 30, 2009 I thank you MadTechie and haku for the help! This is over my head but thank you for your time. 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.