Welcome Guest, Not a member yet? Register   Sign In
codeigniter 3.1.10 index.php code is not concise
#1

(This post was last modified: 03-24-2019, 11:35 AM by hap2000.)

codeigniter 3.1.10 index.php code is not concise,duplicate code in many.
$application_folder = strtr(
rtrim($application_folder, '/\\'),
'/\\',
DIRECTORY_SEPARATOR.DIRECTORY_SEPARATOR
);
Why not deal with it in one place?
for example:
arr=[dir1,dir2,dir3];
foreach($arr as $k=>$v) {
$arr[$k]= strtr(
rtrim($v, '/\\'),
'/\\',
DIRECTORY_SEPARATOR.DIRECTORY_SEPARATOR
}
Reply




Theme © iAndrew 2016 - Forum software by © MyBB