siggibk Posted January 16, 2014 Share Posted January 16, 2014 Okay so i have one question before i start learning php, when you make a function or like date of time, where and how do you make that function appear in a specific division on the site? Do you like make a <div> inside of html for each of the function and then somehow link the function from .php to the html file and then it appears/functions in that section you reffered it in the html file ? I really hope some of you understand where i'm going with this, sorry for my terrible explanation and my english. Quote Link to comment https://forums.phpfreaks.com/topic/285423-starting-to-learn-php-please-help-me/ Share on other sites More sharing options...
Solution requinix Posted January 16, 2014 Solution Share Posted January 16, 2014 (edited) It sounds like you should start learning PHP now and ask questions later, rather than ask questions now and learn later. Because the whole idea of learning is so that you don't have to ask questions Short version? You define the function somewhere* and call it at the point you want. Like if the function is function now() { return date("Y-m-d H:i:s"); }then you can call it as whatever HTML you want here <?php echo now(); // echo to output whatever value now() returned ?> whatever other HTML you want hereDIVs or SPANs or whatever, it doesn't matter as far as PHP is concerned. * It has to be defined by the time you try to use it. That means you define it in the same file (for the most part), or you define it in another file and require that file (at which point PHP will execute that file and "load" the function). Edited January 16, 2014 by requinix Quote Link to comment https://forums.phpfreaks.com/topic/285423-starting-to-learn-php-please-help-me/#findComment-1465485 Share on other sites More sharing options...
siggibk Posted January 16, 2014 Author Share Posted January 16, 2014 Thank you for the answer and yes you are right i should just start learning and ask questions later if i have any, thanks anyway Quote Link to comment https://forums.phpfreaks.com/topic/285423-starting-to-learn-php-please-help-me/#findComment-1465493 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.