pranshu82202 Posted July 11, 2011 Share Posted July 11, 2011 Can you guyzz give me some link of tutorials in which html is coded inside php. Well give mo a example how to echo ("Hello World"); in a particular font face and size...... Quote Link to comment https://forums.phpfreaks.com/topic/241728-html-in-php/ Share on other sites More sharing options...
AbraCadaver Posted July 11, 2011 Share Posted July 11, 2011 Same way as HTML. Depends on whether you use style sheets or what. If your page has a .php extension: <div style="font-family: serif; font-size: medium"><?php echo "Hello World"; ?></div> Or: echo '<div style="font-family: serif; font-size: medium">Hello World</div>'; Quote Link to comment https://forums.phpfreaks.com/topic/241728-html-in-php/#findComment-1241506 Share on other sites More sharing options...
Maq Posted July 11, 2011 Share Posted July 11, 2011 Google - http://php.net/manual/en/faq.html.php - If you have a specific issue come back and ask. Quote Link to comment https://forums.phpfreaks.com/topic/241728-html-in-php/#findComment-1241507 Share on other sites More sharing options...
IrOnMaSk Posted July 11, 2011 Share Posted July 11, 2011 never seen html tag inside php tag, most like it's the other way around... maybe give just little bit more explaination of what you're trying to do... will be happy to help Quote Link to comment https://forums.phpfreaks.com/topic/241728-html-in-php/#findComment-1241597 Share on other sites More sharing options...
AyKay47 Posted July 11, 2011 Share Posted July 11, 2011 never seen html tag inside php tag, most like it's the other way around... maybe give just little bit more explaination of what you're trying to do... will be happy to help you can most certainly print html tags with PHP..... Quote Link to comment https://forums.phpfreaks.com/topic/241728-html-in-php/#findComment-1241608 Share on other sites More sharing options...
Maq Posted July 12, 2011 Share Posted July 12, 2011 never seen html tag inside php tag, most like it's the other way around... maybe give just little bit more explaination of what you're trying to do... will be happy to help Look at AbraCadaver's post. Quote Link to comment https://forums.phpfreaks.com/topic/241728-html-in-php/#findComment-1241808 Share on other sites More sharing options...
IrOnMaSk Posted July 12, 2011 Share Posted July 12, 2011 hehe, which part of AbraCadaver's code is the HTML Tag INSIDE the PHP Tag? I was talking about this <?php <html>blabla</html ?> Quote Link to comment https://forums.phpfreaks.com/topic/241728-html-in-php/#findComment-1241838 Share on other sites More sharing options...
AyKay47 Posted July 12, 2011 Share Posted July 12, 2011 hehe, which part of AbraCadaver's code is the HTML Tag INSIDE the PHP Tag? I was talking about this <?php <html>blabla</html ?> the part where he echos HTML echo '<div style="font-family: serif; font-size: medium">Hello World</div>'; you cannot have HTML in php tags like you have shown, must be echoed/printed, must be parsed as a string Quote Link to comment https://forums.phpfreaks.com/topic/241728-html-in-php/#findComment-1241841 Share on other sites More sharing options...
IrOnMaSk Posted July 12, 2011 Share Posted July 12, 2011 hehe, did some research, I opened my eyes, then I saw!!! maybe I haven't code enough to see the efficiency or the effectiveness of coding that way... but sure pranshu82202 you can put the html coding in the the ECHO... works just find... I just really seen... Quote Link to comment https://forums.phpfreaks.com/topic/241728-html-in-php/#findComment-1241843 Share on other sites More sharing options...
premiso Posted July 12, 2011 Share Posted July 12, 2011 IrOnMaSk, there really is no effectiveness or efficiency. Ideally you should separate the business logic from view logic. On the view side is where the html etc would be placed, without requiring to echo out any html code. This would keep your business logic clean and make it a ton easier for changes in the future, IE you just have to change the HTML side of things instead of tinkering with the actual code. That is just my 2cents however. But yes, you can echo any html tag from within PHP. Quote Link to comment https://forums.phpfreaks.com/topic/241728-html-in-php/#findComment-1241869 Share on other sites More sharing options...
IrOnMaSk Posted July 12, 2011 Share Posted July 12, 2011 thax for the advice premiso Quote Link to comment https://forums.phpfreaks.com/topic/241728-html-in-php/#findComment-1241874 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.