to change all the directories to 755:
find /opt/lampp/htdocs -type d -exec chmod 755 {} \;
to change all the files to 644:
find /opt/lampp/htdocs -type f -exec chmod 644 {} \;
find /opt/lampp/htdocs -type d -exec chmod 755 {} \;
find /opt/lampp/htdocs -type f -exec chmod 644 {} \;
array explode ( string $delimiter , string $string [, int $limit ] )
<?php
$str = 'one|two|three|four';
// positive limit
print_r(explode('|', $str, 2));
<?php
$str = 'one|two|three|four';
// negative limit (since PHP 5.1)
print_r(explode('|', $str, -1));
<?php
$str = 'one|two|three|four';
// limit with 0 and 1 would be same
print_r(explode('|', $str, 0));
<?php
$array = array('XXX', 'TTT', '2123123');
$dash_separated = implode("-", $array);
var_dump($dash_separated);
<?php
//When using empty array it will return empty string even passed the glue
var_dump(implode('hello', array()));
<?php
//When imploding boolean values it will just return the values of true
var_dump(implode('',array(true, true, false, false, true)));
<?php
//Quite handier with sql functions with arrays
$fields = array(
'subject' => 'go green',
'message' => 'i am going to take off!'
);
$sql = 'INSERT INTO table_name';
$sql .= " VALUES (`" . implode("`,`", array_keys($fields)) . "`)";
$sql .= " ('" . implode("','", $fields) . "')";
var_dump($sql);
$userIds = array(2, 32, 55, 200, 44);
$sql2 = "SELECT * FROM table_name";
$sql2 .= " WHERE 1 AND (id=" . implode(" OR id = ", $userIds) . ")";
var_dump($sql2);