• PHP

    PHP Types:: Boolean

    Booleans ¶ This is the simplest type. A bool expresses a truth value. It can be either TRUE or FALSE. Syntax ¶ To specify a bool literal, use the constants TRUE or FALSE. Both are case-insensitive. Typically, the result of an operator which returns a bool value is passed on to a control structure. Converting to boolean ¶ To explicitly convert a value to bool, use the (bool) or (boolean) casts. However, in most cases the cast is unnecessary, since a value will be automatically converted if an operator, function or control structure requires a bool argument. See also Type Juggling. When converting to bool, the following values are considered FALSE: the boolean FALSE itself the integers 0 and -0 (zero) the floats 0.0 and -0.0 (zero) the empty string, and the string “0” an array with zero elements the special type NULL (including unset variables) SimpleXML objects created from empty…

  • PHP

    Types of PHP variables

    Booleans ¶ This is the simplest type. A bool expresses a truth value. It can be either TRUE or FALSE. Syntax ¶ To specify a bool literal, use the constants TRUE or FALSE. Both are case-insensitive.$foo = True; // assign the value TRUE to $foo?> Typically, the result of an operator which returns a bool value is passed on to a control structure. Converting to boolean ¶ To explicitly convert a value to bool, use the (bool) or (boolean) casts. However, in most cases the cast is unnecessary, since a value will be automatically converted if an operator, function or control structure requires a bool argument. See also Type Juggling. When converting to bool, the following values are considered FALSE: the boolean FALSE itself the integers 0 and -0 (zero) the floats 0.0 and -0.0 (zero) the empty string, and the string “0” an array with zero elements the special type NULL (including unset variables) SimpleXML objects created from empty…

  • PHP

    Comments in PHP

    PHP supports ‘C’, ‘C++’ and Unix shell-style (Perl style) comments. For example: The “one-line” comment styles only comment to the end of the line or the current block of PHP code, whichever comes first. This means that HTML code after // ... ?> or # ... ?> WILL be printed: ?> breaks out of PHP mode and returns to HTML mode, and // or # cannot influence that. This is an  example The header above will say 'This is an  example'. ‘C’ style comments end at the first */ encountered. Make sure you don’t nest ‘C’ style comments. It is easy to make this mistake if you are trying to comment out a large block of code.

  • PHP

    PHP tags

    When PHP parses a file, it looks for opening and closing tags, which are   and ?> which tell PHP to start and stop interpreting the code between them. Parsing in this manner allows PHP to be embedded in all sorts of different documents, as everything outside of a pair of opening and closing tags is ignored by the PHP parser. PHP includes a short echo tag  which is a short-hand to the more verbose  PHP also allows for short open tag  (which is discouraged since it is only available if enabled using the short_open_tag php.ini configuration file directive, or if PHP was configured with the –enable-short-tags option). If a file contains only PHP code, it is preferable to omit…

  • PHP,  programming languages

    Popular PHP Frameworks For Web Development in 2020

    Today, you can see a lot of advertising in which the company makes a landmark for 2020. The beginning of a new decade always marks a big change. For example, the first iPad appeared exactly at the start of 2010. It was a huge step forward in the development of tablets and computer technology in general. Source: https://merehead.com/People are waiting from 2020 something supernatural, although it remains quite a bit. In fact, the near future of web development is already known today. Some trends appeared a year earlier. What are Best PHP Frameworks to use in 2020? Here is the list of the Best PHP Frameworks to use in 2020 are: Laravel Symfony Code…

  • PHP

    Your First PHP page

    Create a file named helloworld.php and put it in your web server’s root directory (DOCUMENT_ROOT) with the following content: Example #1 Our first PHP script: helloworld.php Use your browser to access the file with your web server’s URL, ending with the /helloworld.php file reference. When developing locally this URL will be something like http://localhost/helloworld.php or http://127.0.0.1/helloworld.php but this depends on the web server’s configuration. If everything is configured correctly, this file will be parsed by PHP and the following output will be sent to your browser: This program is extremely simple and you really did not need to use PHP to create a page like this. All it does is display: Hello World using the PHP echo statement. Note that the file does not…

  • PHP

    What do I need to write a PHP program

    In this tutorial we assume that your web server has activated support for PHP and that all files ending in .php are handled by PHP. If your server supports PHP, then you do not need to do anything. Just create your .php files, put them in your web directory and the server will automatically parse them for you. There is no need to compile anything nor do you need to install any extra tools. Think of these PHP-enabled files as simple HTML files with a whole new family of magical tags that let you do all sorts of things. Let us say you want to save precious bandwidth and develop locally. In this case,…

  • PHP

    Install PHP on Modern Windows Systems

    Install Requirements PHP 5.5+ require at least Windows 2008/Vista, or 2008r2, 2012, 2012r2, 2016 or 7, 8, 8.1, 10. Either 32-Bit or 64-bit (aka X86 or X64. PHP does not run on Windows RT/WOA/ARM). As of PHP 7.2.0 Windows 2008 and Vista are no longer supported. PHP requires the Visual C runtime(CRT). Many applications require that so it may already be installed. PHP 5.5 and 5.6 require VC CRT 11 (Visual Studio 2012). See: » https://www.microsoft.com/en-us/download/details.aspx?id=30679 PHP 7.0 and 7.1 require VC CRT 14 (Visual Studio 2015). PHP 7.2, 7.3 and 7.4 require VC CRT 15 (Visual Studio 2017). The Microsoft Visual C++ Redistributable for Visual Studio 2019 is suitable for all…

  • PHP

    How to Install and Configure PHP 7.2 on Ubuntu 18.04

    PHP and related packages are the most commonly used components when deploying a web server. In this article, we will learn how to setup PHP 7.2 on Ubuntu 18.04 LTS. Prerequisites An up-to-date Ubuntu 18.04 server instance. A sudo user. Update Ubuntu 18.04 First, update the list of packages: Next, install the updates: Install a webserver You can use Apache or Nginx as your webserver. To install and start Apache: Install PHP 7.2 PHP 7.2 is included in the default Ubuntu repository for 18.04. You can list each of the available PHP 7.2 packages with the following command: Next, install the packages that your application requires: Finally, restart your webserver…

  • PHP

    What can PHP do?

    Anything. PHP is mainly focused on server-side scripting, so you can do anything any other CGI programs can do, such as collect form data, generate dynamic page content, or send and receive cookies. But PHP can do much more.There are three main areas where PHP scripts are used. Server-side scripting. This is the most traditional and main target field for PHP. You need three things to make this work: the PHP parser (CGI or server module), a web server and a web browser. You need to run the web server, with a connected PHP installation. You can access the PHP program output with a web browser, viewing the PHP page…