<?php
$response='https://api.vk.com/blank.html#access_token=12345678900987654321&expires_in=0&user_id=123456789';
$token=preg_replace('#.+access_token=([^&]+?)&.+#uim','$1',$response);
echo $token, PHP_EOL;
$token=explode('#',$response,2);
$token=array_reduce(explode('&',end($token)),function($res,$item){
$item=explode('=',$item);
$res[reset($item)]=end($item);
return $res;
},array());
$token=$token['access_token'];
echo $token;
http://sandbox.onlinephpfunctions.co...b79f0460dc551f