Resolved - Add "Recent Posts" to Website

nootkan
Sr. Bludit
Posts: 43
Joined: Tue Feb 14, 2017 4:59 pm

That is great! Thanks for all your support.

Can I ask why in the first example the functions are placed inside a div and in the second they are not?

Code: Select all

echo '<div class="post-title">'.$post['title'].'</div>';

Code: Select all

$postTitle = $post['title'];
User avatar
Edi
Site Admin
Posts: 3121
Joined: Sun Aug 09, 2015 5:01 pm
Location: Zurich
Has thanked: 54 times
Been thanked: 77 times
Contact:

div is a HTML tag that can be used for CSS formatting:

HTML <div> Tag
Clickwork - Websites mit Bludit | Planet Bludit - Tipps und Snippets
nootkan
Sr. Bludit
Posts: 43
Joined: Tue Feb 14, 2017 4:59 pm

Thanks for your reply. Yes I understand why a div is used in html but I just didn't understand why php doesn't need it to place the functions on separate lines without using divs. No problem, that is why I guess I can't get my head around php. Hopefully someday everything clicks and I'll be able to understand the logic behind php. I'll close this thread now and once again thanks for all your help.
User avatar
Edi
Site Admin
Posts: 3121
Joined: Sun Aug 09, 2015 5:01 pm
Location: Zurich
Has thanked: 54 times
Been thanked: 77 times
Contact:

nootkan wrote:Yes I understand why a div is used in html but I just didn't understand why php doesn't need it to place the functions on separate lines without using divs.
I do not really understand your question... Can you please give an example of "place the functions on separate lines without using divs".
Clickwork - Websites mit Bludit | Planet Bludit - Tipps und Snippets
Post Reply