<?php
function pkcs5_pad ($text)
{
$size = mcrypt_get_block_size (MCRYPT_RIJNDAEL_128, MCRYPT_MODE_CBC);
$pad = $size - (strlen($text) % $size);
return $text . str_repeat(chr($pad), $pad);
}
function pkcs5_unpad ($text)
{
$pad = ord ($text{strlen ($text) - 1});
if ($pad > strlen ($text))
return false;
if (strspn($text, $text{strlen($text) - 1}, strlen($text) - $pad) != $pad) {
return false;
}
return substr($text, 0, -1 * $pad);
}
$key = '140b41b22a29beb4061bda66b6747e14';
$enc = '4ca00ff4c898d61e1edbf1800618fb2828a226d160dad07883d04e008a7897ee2e4b7465d5290d0c0e6c6822236e1daafb94ffe0c5da05d9476be028ad7c1d81';
$iv = substr ($enc, 0, 32);
$enc = substr ($enc, 32);
$iv = hex2bin ($iv);
$enc = hex2bin ($enc);
$key = hex2bin ($key);
$dec = mcrypt_decrypt (MCRYPT_RIJNDAEL_128, $key, $enc, MCRYPT_MODE_CBC, $iv);
$dec = pkcs5_unpad ($dec);
echo "$dec\n"; /* Basic CBC mode encryption needs padding. */
Необходимо объявить массив в PascalScript.
Должен ли тру веб-программист, бэк-эндщик (PHP, ASP.NET, Node.js - неважно) уметь следующее:
Почему не работает контактная форма?
Код рабочий
//div[@class="tovar"]/img[1]
$this->load->library ('pagination');
$pg_cfg = array (
'base_url' => base_url () . 'gallery/show_album/' . $id . '/',
'total_rows' => count ($images),
'per_page' => $this->Gallery_model->get_images_number_per_page (),
'uri_segment' => 4,
'num_links' => 10,
'full_tag_open' => '<p class="paginator"> Страницы: ',
'full_tag_close' => '</p>',
'first_link' => 'первая',
'first_tag_open' => '<span>',
'first_tag_close' => '</span>',
'last_link' => 'последняя',
'last_tag_open' => '<span>',
'last_tag_close' => '</span>',
'prev_tag_open' => '<span>',
'prev_tag_close' => '</span>',
'next_tag_open' => '<span>',
'next_tag_close' => '</span>',
'num_tag_open' => '<span>',
'num_tag_close' => '</span>',
'cur_tag_open' => '<span class="current">',
'cur_tag_close' => '</span>',
);
$this->pagination->initialize ($pg_cfg);
$pg_links = $this->pagination->create_links ();