Jump to content

Discord   |   Play games and chat with our PC gaming community in Discord.
Launch Discord  
Photo

Basics of PHP or some cool stuff :D


  • Please log in to reply
2 replies to this topic

#1
frostb1te198

frostb1te198
  • Forum Member
  • Animation - Programming

  • 42 posts

So this entire mouth when I have time I decided to learn PHP so this is what I learn so far and I thought of showing/teaching you guys it :D Enjoy :D

 

So to know PHP you need to know basic HTML witch isn't that hard to learn so yea lets get started. 

 

 

So yea before we begin lets talk about whats PHP, PHP is Hypertext Processor.

And to what Goggle said to let you guys get a good understanding of it 

is a widely-used open source general-purpose scripting language that is especially suited for web development and can be embedded into HTML.

So I started off learning what to put in first I guess you could say. So before you look at the code I want you to know that you put your <?php          ?> between your body tags now those you who do not know what tags are it is this <> so yea.

 

 

So you can see where using HTML right because like Google said of the definition or what PHP is is used in web development or well Websites. So now you can change the <title>PHP stuff yeaaa :D</title> to what ever you want but in the tags just change "PHP stuff yeaaa :D" to what ever you want manly it doesn't matter because now at all websites have titles like at the top of your web browser say a website you will say the name of the tab basically.

<html>




    <head>
   <title>PHP stuff yeaaa :D</title>
</head>


<body>


<?php




?>






</body>
</html>

Ok so now that out of the way lets learn what comments and how to use them :D

 

Multi line comment:  

/* This is a comment that multi line D:D:D:D
*/
 
 
Single Line Comment: 
// This is a single line comment :D:D:D:D:D:D:D:D lol these :D 
 
 
Then well honestly I don't know what this is called all I know it by is another comment:
                                       
                                   
# This is another comment

So now I want to go on with the echos....  So if we do an Echo well if you refresh your page you will have a the "Data processed" text on there and if you what it to be I believe its like if you add like this lol \ / right it will be like this echo"<p>\Data processed/</>'; It will be like 'Data processed' . I could be wrong I'm sorry if I am. But it worked for me :D

 echo"<p>Data porcessed</>";
So know we will do the date stuff so say you want today day or something like 6/24/15 something like that well you need to learn this date cart so frist this first add this to your code of date_default_timezone_set('UTC');  Then you can add your cart I have mind as a multi line comment just so I don't forget it cause you got to admit it kinda does sometimes... 
 
/* Ehcos the date
       h : 12 hr format
H : 24 hr format
i : minutes
s : seconds
u : Microseconds
a : Lowercase am or pm
l : Full text for the day
F : Full text for the mouth
j : Day of the mounth
S : Suffix for the day st, nd, rd, etc
Y : 4 digit y */

Yea so you see what I mean now about you can sometimes forget some :P Alright so now the thing is how do I make it to put the date down well first where going to put another echo. Like so.. 

 

You can see that I put h i s u a l F and stuff it can get confusing at times if you know what it is. Something I forgot to mention that when on your site when anyone tries to inspected element they will not be able to see the PHP I don't know why but be glad no one can steal your code of PHP.

echo date('h:i:s:u a, l F jS Y e');
Ok so don't put this in your code or at least not yet this is Data types I just wanted you guys to know this. 
 
Integer : Whole Numbers
Float : Decimal Numbers
String : Strings or characters
Boolean : true or false
Array : Multiple Items
Object : A Object defined by a class

Now I'm sorry but it is late to be exact it is 4:17am lol so I'm going to half to stop now I will try to answer questions :D I hope this help some. I know this wasn't a lot to learn but sorry its late :( so yea I will try my best to answer questions but I'll see yall next time :D

 



#2
Paronity

Paronity

  • Forum Member
  • var Paronity = new Guru();

  • 16,885 posts

Nice and simple write-up. It's a little hard to follow, kinda like you are writing it on the fly and it doesn't flow 100% in the order it should. I would recommend writing things up over time in Word, or even notepad and going over them to make sure they flow the way you intend. 

 

I appreciate tutorials as much as the next guy, but you just have to make sure they flow. :) Be a little more rigid with the steps that you want a person to take and what the outcome should look like. 

 

One small correction for ya: PHP Stands for PRE Hypertext Processor. The PHP code is processed before the hypertext (HTML), so this is where the name comes from. :)

 

Don't take this as me telling you that you are terrible, just trying to help you make the best guides/tutorials you can. :)



#3
frostb1te198

frostb1te198
  • Forum Member
  • Animation - Programming

  • 42 posts

Nice and simple write-up. It's a little hard to follow, kinda like you are writing it on the fly and it doesn't flow 100% in the order it should. I would recommend writing things up over time in Word, or even notepad and going over them to make sure they flow the way you intend. 

 

I appreciate tutorials as much as the next guy, but you just have to make sure they flow. :) Be a little more rigid with the steps that you want a person to take and what the outcome should look like. 

 

One small correction for ya: PHP Stands for PRE Hypertext Processor. The PHP code is processed before the hypertext (HTML), so this is where the name comes from. :)

 

Don't take this as me telling you that you are terrible, just trying to help you make the best guides/tutorials you can. :)

Thanks @Paronity it was 4am lol. And I'll write something that flows next time :D:D:D Thanks for correcting me <3 






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users