http://php.net/manual/en/function.explode.php
Explode splits a string into an array e.g.
<?php
$string="1&2&3&4&5&6&7";
$array=explode("&",$string);
?>
Array will be 7 in lenght containg
1
2
3
4
5
6
7
so ur example would be
<?php
$data = "page=1&data=1:21;2:34;5:57&a=yes";
$array=explode(";",$data):
//array[0] will be 1:21
//array[1] will be 2:34
//ect u get the idea, it simple from then on.
//just loop though the array do as u wish then use implode to join them back to string if needed.
foreach ($array as $k => $v)
{
// do what u want to the data here
}
$string=implode($array);
?>
Notes on implode
http://php.net/manual/en/function.implode.php ;
If u want to remove elements from an array you can use unset($array[4]).
http://php.net/manual/en/function.unset.php