Please help A PHP Error was encountered Severity: 8192 Message: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior Filename: MX/Router.php Line Number: 239 Backtrace: File: C:\xampp\htdocs\codeigniter-hmvc\application\third_party\MX\Router.php Line: 239 Function: strpos File: C:\xampp\htdocs\codeigniter-hmvc\application\third_party\MX\Router.php Line: 72 Function: set_class File: C:\xampp\htdocs\codeigniter-hmvc\index.php Line: 315 Function: require_once
‼***For those people whe encounter the following error***‼ A PHP Error was encountered Severity: 8192 Message: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior ➖➖➖➖➖➖➖➖➖***solution***➖➖➖➖➖➖➖➖➖ 1. 🔎🔎🔎got to: application\third_party\MX\Router.php where set_class() is (line 239, just read your error message).🔎🔎🔎 2. 🚩🚩🚩change this part: 🚩🚩🚩 if (strpos($class, $suffix) === FALSE) { $class .= $suffix; } ➡➡➡into this :➡➡➡ $pos = !empty($suffix) ? strpos($class, $suffix) : FALSE; if ($pos === FALSE) { $class .= $suffix; }
php error A PHP Error was encountered Severity: 8192 Message: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior Filename: MX/Router.php Line Number: 239 Backtrace: File: C:\xampp\htdocs\codeigniter-hmvc\application\third_party\MX\Router.php Line: 239 Function: strpos File: C:\xampp\htdocs\codeigniter-hmvc\application\third_party\MX\Router.php Line: 101 Function: _set_default_controller File: C:\xampp\htdocs\codeigniter-hmvc\index.php Line: 315 Function: require_once An uncaught Exception was encountered Type: Error Message: Class 'My_Controller' not found Filename: C:\xampp\htdocs\codeigniter-hmvc\application\core\My_Controller.php Line Number: 5 Backtrace: File: C:\xampp\htdocs\codeigniter-hmvc\index.php Line: 315 Function: require_once
It is the best tutorial so far, I have a question can we make separate routes file in module folder, so project files remain clean, and separated
Thanks you have liked it. Simply you have to create routes.php as normal like others folders and work on that.
very good
Thanks @Emmanuel Gravel
Please help
A PHP Error was encountered
Severity: 8192
Message: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior
Filename: MX/Router.php
Line Number: 239
Backtrace:
File: C:\xampp\htdocs\codeigniter-hmvc\application\third_party\MX\Router.php
Line: 239
Function: strpos
File: C:\xampp\htdocs\codeigniter-hmvc\application\third_party\MX\Router.php
Line: 72
Function: set_class
File: C:\xampp\htdocs\codeigniter-hmvc\index.php
Line: 315
Function: require_once
file not working
‼***For those people whe encounter the following error***‼
A PHP Error was encountered
Severity: 8192
Message: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior
➖➖➖➖➖➖➖➖➖***solution***➖➖➖➖➖➖➖➖➖
1. 🔎🔎🔎got to: application\third_party\MX\Router.php
where set_class() is (line 239, just read your error message).🔎🔎🔎
2. 🚩🚩🚩change this part: 🚩🚩🚩
if (strpos($class, $suffix) === FALSE)
{
$class .= $suffix;
}
➡➡➡into this :➡➡➡
$pos = !empty($suffix) ? strpos($class, $suffix) : FALSE;
if ($pos === FALSE) {
$class .= $suffix;
}
Thanks, it works!
php error
A PHP Error was encountered
Severity: 8192
Message: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior
Filename: MX/Router.php
Line Number: 239
Backtrace:
File: C:\xampp\htdocs\codeigniter-hmvc\application\third_party\MX\Router.php
Line: 239
Function: strpos
File: C:\xampp\htdocs\codeigniter-hmvc\application\third_party\MX\Router.php
Line: 101
Function: _set_default_controller
File: C:\xampp\htdocs\codeigniter-hmvc\index.php
Line: 315
Function: require_once
An uncaught Exception was encountered
Type: Error
Message: Class 'My_Controller' not found
Filename: C:\xampp\htdocs\codeigniter-hmvc\application\core\My_Controller.php
Line Number: 5
Backtrace:
File: C:\xampp\htdocs\codeigniter-hmvc\index.php
Line: 315
Function: require_once