Hi, I want to print this html code into php I don't know php at all. Tried echo and print statements but was getting errors. <div class="content"> <div class="menu"> <ul class="menu"> <li class="leaf first no-dhtml"> <a href="<? php print url('node/' . $my_id . '/announcement', array('absolute' => TRUE)); ?>">Announcement</a></li> <li class="leaf no-dhtml"> <a href="<? php print url('node/' . $my_id . '/assignment', array('absolute' => TRUE)); ?>">Assignment</a></li> </ul> </div> </div> HTML: please note that there is php function called url() whose output I want to display. <? php print url('node/' . $my_id . '/assignment', array('absolute' => TRUE)); ?> PHP:
source http://www.yellowpipe.com/yis/tools/HTML_converter/ As long as your php print statements work this should work fine in a php file. <?php echo "<div class=\"content\">\n"; echo "<div class=\"menu\">\n"; echo " <ul class=\"menu\">\n"; echo " <li class=\"leaf first no-dhtml\">\n"; echo " <a href=\"<?php print url('node/' . $my_id . '/announcement', array('absolute' => TRUE)); ?>\">Announcement</a></li>\n"; echo " <li class=\"leaf no-dhtml\">\n"; echo " <a href=\"<?php print url('node/' . $my_id . '/assignment', array('absolute' => TRUE)); ?>\">Assignment</a></li>\n"; echo " </ul>\n"; echo "</div>\n"; echo "</div>\n"; ?> PHP:
Thank you very much for the link, I'll try it and let you know the results. but i shal keep this line separate echo " <a href=\"<?php print url('node/' . $my_id . '/announcement', array('absolute' => TRUE)); ?>\">Announcement</a></li>\n";