Posts: 1,832
Location: Somewhere else entirely
|
If you want to actually remove the sid completely, you can do something like this:
PHP Code:
<?php function find_session() { global $linksarray; foreach($linksarray as $key => $value) { $str = preg_replace('#sid=[abcdef0-9]{32}#',"",$value); $str = preg_replace('#(\?|\&(amp;)?)\&(amp;)?#',"\\1",$str); $linksarray[$key] = preg_replace('#\?$#',"",$str); } }
$linksarray = Array( "http://www.something.com?sid=abd6e7f8c9e0adc9e7f8b9037dbe7293&one=one&two=two", "http://www.something.com?three=three&sid=abd6e7f8c9e0adc9e7f8b9037dbe7293&one=one&two=two", "http://www.something.com?sid=abd6e7f8c9e0adc9e7f8b9037dbe7293" ); echo "<pre>"; print_r($linksarray);
find_session();
print_r($linksarray); echo "</pre>"; ?>
That code results in the output:
Code:
Array
(
[0] => http://www.something.com?sid=abd6e7f8c9e0adc9e7f8b9037dbe7293&one=one&two=two
[1] => http://www.something.com?three=three&sid=abd6e7f8c9e0adc9e7f8b9037dbe7293&one=one&two=two
[2] => http://www.something.com?sid=abd6e7f8c9e0adc9e7f8b9037dbe7293
)
Array
(
[0] => http://www.something.com?one=one&two=two
[1] => http://www.something.com?three=three&one=one&two=two
[2] => http://www.something.com
)
(My browser flattened the & s into plain & when rendered).
__________________
UPDATE 0beron SET talkupation = talkupation + lots WHERE post = 'helpful';
Please login or register to view this content. Registration is FREE (aka MSN handwriting for forums)
|