'<module:\w+>/<controller:\w+>/<action:\w+>' => '<module>/<controller>/<action>',
'<controller:\w+>/<action:\w+>' => 'myshop/<controller>/<action>',
'<_m:[\w\-]+>' => '<_m>/default/index',
'<_m:[\w\-]+>/<_c:[\w\-]+>' => '<_m>/<_c>/index',
'<_m:[\w\-]+>/<_c:[\w\-]+>/<_a:[\w\-]+>' => '<_m>/<_c>/<_a>',
'<_m:[\w\-]+>/<_c:[\w\-]+>/<id:\d+>' => '<_m>/<_c>/view',
'<_m:[\w\-]+>/<_c:[\w\-]+>/<id:\d+>/<_a:[\w\-]+>' => '<_m>/<_c>/<_a>',
$key = 'key2';
uasort($arr, function($a,$b) use($key){
if ($a[$key] == $b[$key]) {
return 0;
}
return ($a[$key] < $b[$key]) ? -1 : 1;
});
//update
/*
@param array $arr array to sort
@param string $key key
@param int $direction 1 or -1
*/
function sortByKey($arr, $key, $direction = 1){
uasort($arr, function($a,$b) use($key, $direction){
if ($a[$key] == $b[$key]) {
return 0;
}
return ($a[$key] < $b[$key]) ? -1*$direction : 1*direction;
});
return $arr
}
$html = '<div style="display: inline-block;">FIND_ME</div>';
$parse = str_get_html($html);
echo $parse->find('div[style="display: inline-block;"]', 0)->innertext;
string text = "[текст 1] необходимый текст [текст 2]";
Regex re = new Regex(@"\](.+)\[", RegexOptions.IgnoreCase);
Match m = re.Match(text);
// m.Groups[1].Value будет содержать необходимый вам текст.
// Нулевой элемент массива m.Groups содержит исходный текст.
Console.WriteLine(m.Groups[1].Value);
var commandText = "UPDATE Sales.Store SET Demographics = @demographics WHERE CustomerID = @ID;";
using (SqlConnection connection = new SqlConnection(connectionString))
{
SqlCommand command = new SqlCommand(commandText, connection);
command.Parameters.AddWithValue("@ID", customerID);
command.Parameters.AddWithValue("@demographics", demoXml);
connection.Open();
command.ExecuteNonQuery();
}