GithubHelp home page GithubHelp logo

php-basics's Introduction

PHP-Basics

Basic notions of PHP language

Table of Contents
  1. About The Project
  2. Getting Started
  3. Contributing
  4. Contact

About The Project

In this project I go through all the basic concept of PHP.

  1. PHP configuration
  2. echo, print, print_r
  3. Iterators
  4. Expressions and Operators
  5. Date and Time
  6. Conditional Statement
  7. Data Types
  8. Strings
  9. Arrays
  10. Functions

Built With

This section should list any major frameworks that you built your project using.

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

Prerequisites

It is important that before starting you have an environment capable of running PHP in a version higher than 7.2. As we are going to use XAMPP we will be running 8 version which is the newest one. Here you can see the PHP releases:

https://www.php.net/downloads

Installing

To intalling and use this project you will need:

  1. Install XAMPP

    https://www.apachefriends.org/download.html
  2. Press start in order to turn on the services.

  3. Go to XAMPP application and press the tab Volumes and press mount button once it is mounted you can press the button explore to open the XAMPP directory.

  4. Clone the repo inside of htdocs for our project.

    git clone https://github.com/fab-rvn/PHP-Basics.git

Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Contact

Fabrizio Ervini - @faber_dev - [email protected]

Project Link: https://github.com/fab-rvn/PHP-Basics.git

php-basics's People

Stargazers

Roman avatar

Watchers

Fabrizio Ervini avatar

php-basics's Issues

Conditionals

  • Create a simple condition that evaluates whether the current day is Monday. Only in the case that the condition is met, it shows a message of “We are on Monday”.
  • Create a simple condition that evaluates whether the current month is October. If the condition is met, it shows a message of the type "We are in October". Otherwise, if this condition is not met, show the current month in words as it come from DateTime.
  • Create a double condition that evaluates:
    If the current minute is less than 10. Displays a message of type "the current minute is less than 10", if the current minute is greater than 15, displays a message of the type "the current minute is more than 15". If you do not meet any of the two conditions above: Displays a message of the type "does not meet any conditions”
  • Create a switch type control structure to display a different message depending on the current day of the week. You can write any type of message

Dates

  • Use date class to show year-month-day
  • Get the current date in any format
  • Get the current day
  • Get the current month in numerical format (1-12)
  • Get the current minute with leading zeros (00 - 59)

Operators

  • Use the var_dump PHP function which is to debug variables
  • Use arithmetic operators: +, -, *, /, and%
  • Use a comparison operators: ==,! =, <,>, <=,> =
  • Use a logical operators: &&, ||, !, xor

Functions

  • Generate a function that given two numbers returns the sum of both
  • Generates a function that given two numbers returns the multiplication of both
  • Generates a function that given two numbers returns the division of both
  • Generates a function that, given two numbers and an operation (add, multiply or divide), returns the result of that operation.
  • Depending on the type of operation received by parameter, the function will execute the function responsible for performing the operation, since you have previously implemented the function for each operation separately.

Types

  • Define a new variable and assign a value to each of the following types:
    • Boolean
    • Integer
    • Float
    • String
    • Array
    • Object
    • NULL

Maths

  • Define a variable whose value is the result of the function that returns an absolute value.
  • Define a variable whose value is the result of the function that returns a rounded value to the next highest integer.
  • Define a variable whose value is the result of the function that returns the highest value of a series of values ​​that are received by parameter.
  • Define a variable whose value is the result of the function that returns the lowest value of a series of values ​​that are received by parameter.
  • Define a variable whose value is the result of the function that returns a random number

Arrays

  • Define a simple array composed of text strings
  • Define a simple array consisting of whole numbers and decimal numbers
  • Define a multidimensional array
  • Execute the function that allows to obtain the length of an array
  • Execute the function that allows to obtain the combination of two arrays
  • Execute the function that once is given an array return the last element of it
  • Execute the function that once is given an array add a new element to the array in question

Iterators

  • Make use of "for"
  • Make use of "foreach"
  • Make use of "while"
  • Make use of "do while"

Print

  • Make use of "echo"
  • Make use of "print"
  • Makes use of "print_r"

Info

  • Create a folder called src and inside create a file called index.php
  • Call the phpinfo function and verify the result

Strings

  • Print a text string
  • Print a text string that interpret variables
  • Concatenate a previously declared variable in a text string
  • Execute the function that allows you to replace text in a string (case sensitive)
  • Execute the function that allows you to replace text in a string (without taking into account upper / lower case)
  • Execute the function that allows you to write a text N times
  • Execute the function that allows to obtain the length of a text string
  • Executes the function that allows to obtain the position of the first occurrence of a text within a text string
  • Execute the function that allows a text string to be capitalized
  • Execute the function that allows you to transform a text string to lowercase
  • Execute the function that allows to obtain a text substring from the position

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.