PHP Programming Language
PHP Version
php -v
php.ini
The PHP configuration file (php.ini) is read when PHP starts up. For the server module versions of PHP, this happens only once when the web server is started. For the CGI and CLI versions, it happens on every invocation.
There are a number of possible PHP configuration files, each for a different use:
Config For | php.ini File Path |
---|---|
Apache Configures the PHP module for the Apache web server. |
/etc/php/7.0/apache2/php.ini |
Command Line Configures PHP for use on the command line. |
/etc/php/7.0/cli/php.ini |
CGI Mode Configures PHP for use with the php-cgi system. |
/etc/php/7.0/cgi/php.ini |
See the list of php.ini directives.
Find the loaded ini files with:
sudo find /etc -name php.ini
Binary files location
which php
Code References
Concatenating Strings
Using arrays
// Concatenate lines with an an array to maintain line breaks.
function get_div( $content )
{
$output = array();
$output[] = '<div>';
$output[] = $content;
$output[] = '</div>';
return implode("\n", $output);
}
// Example:
echo get_div('hello');
// Outputs:
// <div>
// hello
// </div>