Convert Javascript Array into PHP Array

Standard

String Javascript Array
For Example: [“A”,2,[[1,1,1,"A","J",1],[1,2,1,"B","J",1],[1,4,1,"C","J",1]]]

$string_array = '["A",2,[[1,1,1,"A","J",1],[1,2,1,"B","J",1],[1,4,1,"C","J",1]]]';

Convert String to Value/array in PHP

$array = eval("return $string_array;");

Result Array

print_r($array);

Full Code:

$string_array = '["A",2,[[1,1,1,"A","J",1],[1,2,1,"B","J",1],[1,4,1,"C","J",1]]]';

$array = eval("return $string_array;");
print_r($array);

Protecting a file using chattr command

Standard

Write protecting a file using chattr command

Let say you want to write protect the file called data.txt so that no other users can change it including root user, enter (you must login as the root user to use chattr command):

# chattr +i data.txt

To remove i attribute, enter:

# chattr -i data.txt