preg_replace('/(@[a-zA-Zа-яА-Я0-9]+?)#(\d+)/u', '<a href="/user/$2" class="user-tag">$1</a>', $text);
Без скрытого поля никак не обойтись, или есть способы?
$url = preg_replace('/page_[0-9]+\//', '', '/catalog/masla-zhidkosti-i-smazki/page_2/');
UPDATE table SET uid = CASE
WHEN id = 1 THEN 2952
WHEN id = 2 THEN 4925
WHEN id = 3 THEN 1592
ELSE uid
END
WHERE id IN (1,2,3)
$postdata = http_build_query(
array(
'var1' => 'some content',
'var2' => 'doh'
)
);
$opts = array(
'http'=>array(
'method'=>"POST",
'header'=>"Accept-language: en\r\n" .
"Cookie: foo=bar\r\n" .
"User-agent: BROWSER-DESCRIPTION-HERE\r\n"
),
'content' => $postdata
);
$context = stream_context_create($opts);
$file = file_get_contents('http://www.example.com/', false, $context);
$curl_h = curl_init('http://www.example.com/');
curl_setopt($curl_h, CURLOPT_HTTPHEADER,
array(
'User-Agent: BROWSER-DESCRIPTION-HERE',
)
);
curl_setopt($curl_h, CURLOPT_POST, 1);
curl_setopt($resource, CURLOPT_POSTFIELDS, array('key' => '123213'));
curl_setopt($curl_h, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($curl_h);
// символы которые находится между id и user заменяем на символ *
preg_replace('/(?<=id)(.*?)(?=user))/is', '$1 * $3', $str)
$t_s = preg_replace('/^0(.*)/', '$1', $t_s);
$out= str_replace(":",".",$t_s);
$opts = array('http' =>
array(
'method' => 'GET',
'header' => array(
'Accept-Language: ru-Ru,ru;q=0.8',
'User-Agent: '.$_SERVER['HTTP_USER_AGENT'],
)
)
);
$context = stream_context_create($opts);
echo file_get_contents('https://sbonhelp.ru/registraciya-v-sberbank-online', false, $context);