function isString(s) {
return typeof(s) === 'string' || s instanceof String;
}
<?php
$Clients = Array
(
'Client' => Array
(
'ClientDetails' => Array
(
'clientName' => '',
'clientContact' =>'',
'clientContactEmail' => 'client1@example.com',
'clientTelephone' => '',
),
'properties' => Array
(
'Property' => Array
(
0 => Array
(
'propertyid' => '',
'lastUpdateDate' => '',
'category' => '',
'Address' =>'',
)
)
),
),
'Client2' => Array
(
'ClientDetails' => Array
(
'clientName' => '',
'clientContact' =>'',
'clientContactEmail' => 'client2@example.com',
'clientTelephone' => '',
),
'properties' => Array
(
'Property' => Array
(
0 => Array
(
'propertyid' => '',
'lastUpdateDate' => '',
'category' => '',
'Address' =>'',
)
)
),
)
);
function mySearch($search, $data, $parents = array())
{
$return = [];
if(is_array($data))
{
foreach($data as $key => $value)
{
if($key === $search)
{
$return[] = array (
'key' => array_merge($parents, array($key)),
'value' => $value,
);
}
else if(is_array($value))
{
$return = array_merge($return, mySearch($search, $value, array_merge($parents, array($key))));
}
}
}
return $return;
}
header('content-type: text/html; charset=utf-8;');
echo '<pre>';
@print_r(mySearch('clientContactEmail' , $Clients));
echo '</pre>';
exit(__FILE__ .': '. __LINE__);
server {
listen 80;
server_name www.site.com;
return 301 http://site.com$request_uri;
}
server {
listen 80 default_server;
server_name site.com *.site.com;
root /var/www;
index index.php index.html index.htm;
...
}
INSERT INTO `table` (`ID`, `City`, `Color`)
SELECT `ID`, `City`, `Color`
FROM `users` WHERE `Name` = "Test"
// или если id не надо
INSERT INTO `table` (`ID`, `City`, `Color`)
SELECT null, `City`, `Color`
FROM `users` WHERE `Name` = "Test"