A PHP Error was encountered

Severity: 8192

Message: Return type of CI_Session_files_driver::open($save_path, $name) should either be compatible with SessionHandlerInterface::open(string $path, string $name): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice

Filename: drivers/Session_files_driver.php

Line Number: 132

Backtrace:

File: /home/infovistar/public_html/application/controllers/php/Php.php
Line: 7
Function: __construct

File: /home/infovistar/public_html/index.php
Line: 315
Function: require_once

A PHP Error was encountered

Severity: 8192

Message: Return type of CI_Session_files_driver::close() should either be compatible with SessionHandlerInterface::close(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice

Filename: drivers/Session_files_driver.php

Line Number: 292

Backtrace:

File: /home/infovistar/public_html/application/controllers/php/Php.php
Line: 7
Function: __construct

File: /home/infovistar/public_html/index.php
Line: 315
Function: require_once

A PHP Error was encountered

Severity: 8192

Message: Return type of CI_Session_files_driver::read($session_id) should either be compatible with SessionHandlerInterface::read(string $id): string|false, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice

Filename: drivers/Session_files_driver.php

Line Number: 166

Backtrace:

File: /home/infovistar/public_html/application/controllers/php/Php.php
Line: 7
Function: __construct

File: /home/infovistar/public_html/index.php
Line: 315
Function: require_once

A PHP Error was encountered

Severity: 8192

Message: Return type of CI_Session_files_driver::write($session_id, $session_data) should either be compatible with SessionHandlerInterface::write(string $id, string $data): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice

Filename: drivers/Session_files_driver.php

Line Number: 235

Backtrace:

File: /home/infovistar/public_html/application/controllers/php/Php.php
Line: 7
Function: __construct

File: /home/infovistar/public_html/index.php
Line: 315
Function: require_once

A PHP Error was encountered

Severity: 8192

Message: Return type of CI_Session_files_driver::destroy($session_id) should either be compatible with SessionHandlerInterface::destroy(string $id): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice

Filename: drivers/Session_files_driver.php

Line Number: 315

Backtrace:

File: /home/infovistar/public_html/application/controllers/php/Php.php
Line: 7
Function: __construct

File: /home/infovistar/public_html/index.php
Line: 315
Function: require_once

A PHP Error was encountered

Severity: 8192

Message: Return type of CI_Session_files_driver::gc($maxlifetime) should either be compatible with SessionHandlerInterface::gc(int $max_lifetime): int|false, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice

Filename: drivers/Session_files_driver.php

Line Number: 356

Backtrace:

File: /home/infovistar/public_html/application/controllers/php/Php.php
Line: 7
Function: __construct

File: /home/infovistar/public_html/index.php
Line: 315
Function: require_once

A PHP Error was encountered

Severity: Warning

Message: ini_set(): Session ini settings cannot be changed after headers have already been sent

Filename: Session/Session.php

Line Number: 282

Backtrace:

File: /home/infovistar/public_html/application/controllers/php/Php.php
Line: 7
Function: __construct

File: /home/infovistar/public_html/index.php
Line: 315
Function: require_once

A PHP Error was encountered

Severity: Warning

Message: session_set_cookie_params(): Session cookie parameters cannot be changed after headers have already been sent

Filename: Session/Session.php

Line Number: 294

Backtrace:

File: /home/infovistar/public_html/application/controllers/php/Php.php
Line: 7
Function: __construct

File: /home/infovistar/public_html/index.php
Line: 315
Function: require_once

A PHP Error was encountered

Severity: Warning

Message: ini_set(): Session ini settings cannot be changed after headers have already been sent

Filename: Session/Session.php

Line Number: 304

Backtrace:

File: /home/infovistar/public_html/application/controllers/php/Php.php
Line: 7
Function: __construct

File: /home/infovistar/public_html/index.php
Line: 315
Function: require_once

A PHP Error was encountered

Severity: Warning

Message: ini_set(): Session ini settings cannot be changed after headers have already been sent

Filename: Session/Session.php

Line Number: 314

Backtrace:

File: /home/infovistar/public_html/application/controllers/php/Php.php
Line: 7
Function: __construct

File: /home/infovistar/public_html/index.php
Line: 315
Function: require_once

A PHP Error was encountered

Severity: Warning

Message: ini_set(): Session ini settings cannot be changed after headers have already been sent

Filename: Session/Session.php

Line Number: 315

Backtrace:

File: /home/infovistar/public_html/application/controllers/php/Php.php
Line: 7
Function: __construct

File: /home/infovistar/public_html/index.php
Line: 315
Function: require_once

A PHP Error was encountered

Severity: Warning

Message: ini_set(): Session ini settings cannot be changed after headers have already been sent

Filename: Session/Session.php

Line Number: 316

Backtrace:

File: /home/infovistar/public_html/application/controllers/php/Php.php
Line: 7
Function: __construct

File: /home/infovistar/public_html/index.php
Line: 315
Function: require_once

A PHP Error was encountered

Severity: Warning

Message: ini_set(): Session ini settings cannot be changed after headers have already been sent

Filename: Session/Session.php

Line Number: 317

Backtrace:

File: /home/infovistar/public_html/application/controllers/php/Php.php
Line: 7
Function: __construct

File: /home/infovistar/public_html/index.php
Line: 315
Function: require_once

A PHP Error was encountered

Severity: Warning

Message: ini_set(): Session ini settings cannot be changed after headers have already been sent

Filename: Session/Session.php

Line Number: 375

Backtrace:

File: /home/infovistar/public_html/application/controllers/php/Php.php
Line: 7
Function: __construct

File: /home/infovistar/public_html/index.php
Line: 315
Function: require_once

A PHP Error was encountered

Severity: Warning

Message: session_set_save_handler(): Session save handler cannot be changed after headers have already been sent

Filename: Session/Session.php

Line Number: 110

Backtrace:

File: /home/infovistar/public_html/application/controllers/php/Php.php
Line: 7
Function: __construct

File: /home/infovistar/public_html/index.php
Line: 315
Function: require_once

A PHP Error was encountered

Severity: Warning

Message: session_start(): Session cannot be started after headers have already been sent

Filename: Session/Session.php

Line Number: 143

Backtrace:

File: /home/infovistar/public_html/application/controllers/php/Php.php
Line: 7
Function: __construct

File: /home/infovistar/public_html/index.php
Line: 315
Function: require_once

PHP Variables
For any queries you can reach us at infovistarindia@gmail.com / WhatsApp us: +919158876092

PHP Variables

PHP Variables

A Variable is a holder used to store both numeric and non-numeric data.

Rules for Variable declaration

  • In PHP, variable starts with a dollar($) sign, succeeded by the name of the variable.
  • In PHP, a variable name must start with a letter or the underscore character.
  • In PHP, a variable name only contains alpha-numeric characters and underscores (A-Z,a-z, 0-9, and _).
  • A variable name must not contain space.

Assigning Values to Variables

<?php 
	$name = "infovistar";
	echo $name;
?>

Example (Addition of two numbers):

<?php
	$a = 10;
	$b = 15;
	$c = $a + $b;
	echo $c;
?>