rhydonphilip

Learning php part 1

Jul 17th, 2016
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.22 KB | None | 0 0
  1. [[]] is a selfnotation of php coding
  2.  
  3. [[$Name = ''The variable under the [name]'' ]] for example ''Bob''
  4. This one will be in the form of a string variable meaning it can't be combined with numbers or actual value.
  5. You can combine strings using:[ ''String part, '' . $name; ] and that will result in:[ String part, Bob] .
  6.  
  7. [+] Means add on numbers
  8. [-] Means minus number
  9. [/] Divide
  10. [*] Multiply
  11. example: $A == $B means variable A has the same value as variable B.
  12. This will be a question to see if the value is true or fals. If the value for instance A = 3 + 5 and B = 3 then it's fals.
  13. while A = 5 + 3 while B = 8 then it did be true.
  14. Checking if it's not equal would be with[$A !== $B]
  15. Logical rythems like [ $A and $B ] if both are true
  16. [ $A or $b] if one of them is true or both.
  17.  
  18. The ''if true'' system:
  19. [ $LoggedIn = true;
  20. if ($LoggedIn == true) {
  21. Echo ''You are logged in'';
  22. } else {
  23. echo '' Please log in''
  24. } ]
  25. Now in this example it would suggest you are logged in because $LoggedIn is set to true. So the result is ''You are Logged in''
  26. if we did change that to false it did look like this:
  27. [ $LoggedIn = false;
  28. if ($LoggedIn == true) { ] etc. so this one would result into ''Please Log in''
Add Comment
Please, Sign In to add comment