london77 Posted December 2, 2010 Share Posted December 2, 2010 Hi, I am wondering if "echo" can contain <?php ?> in it. such as echo ''<?php include ("inc/menu.html"); ?>"; if it cannot contain, then how can make it contain "include ()" ? thanks in advance Link to comment https://forums.phpfreaks.com/topic/220485-can-echo-contain/ Share on other sites More sharing options...
Pikachu2000 Posted December 2, 2010 Share Posted December 2, 2010 If you use single quotes, it will echo the string as a literal. The question is why would you want to do that? What are you trying to accomplish? Link to comment https://forums.phpfreaks.com/topic/220485-can-echo-contain/#findComment-1142304 Share on other sites More sharing options...
london77 Posted December 2, 2010 Author Share Posted December 2, 2010 ok, thnks for the quick reply, i was trying to put some restriction to a page, and if user is not registered he wont be able to see it, even the admin menu which lays right side. Link to comment https://forums.phpfreaks.com/topic/220485-can-echo-contain/#findComment-1142306 Share on other sites More sharing options...
Pikachu2000 Posted December 2, 2010 Share Posted December 2, 2010 This logic should make more sense. Pseudo-code . . . if( $_SESSION['is_logged_in'] === TRUE ) include('logged_in_users_menu.html'); } else { include('generic_users_menu.html'); } Link to comment https://forums.phpfreaks.com/topic/220485-can-echo-contain/#findComment-1142309 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.