Reply to Re: Filtering a url property out of an string??

Your name:

Reply:


Posted by Krustov on 11/02/24 11:33

<comp.lang.php , , projektwi-05@yahoo.de>
<1132593113.760469.23400@f14g2000cwb.googlegroups.com>
<21 Nov 2005 09:11:53 -0800>

> i am looking for a way to filter out from a string with:
>
> "http://xxxxxxx/crew.php?sid=f2a6dd3a14fb27d5ade7c30&stg=0af96ef5466b922831377c4&cmd=show&id=b564065cd3f5187389a93ca"
>
> the information "id=b564065cd3f5187389a93ca"
>
> How could I solve this??
>

"id=b564065cd3f5187389a93ca" is the part you want to keep ? .

You could adapt the following code to suit as it will scan from right to
left until it finds the first = character from the right hand side .

All minor stuff and easily done with some trial and error changes .

If "id=b564065cd3f5187389a93ca" is the part you want to get rid of then
change the php code at the end to suit .


(php code untested)


<?php

$junk="http://xxxxxxx/crew.php?sid=f2a6dd3a14fb27d5ade7c30&stg=
0af96ef5466b922831377c4&cmd=show&id=b564065cd3f5187389a93ca";

print $junk;

$pass="0"; $long=0;

$tv=strlen($junk); $dvd=$tv-1;

while ($pass=="0")
{
$vhs=substr($junk,$dvd,1);
if ($vhs==chr(61)) {$pass=1;}
$long=$long+1; $dvd=$dvd-1;
}

$vhs=substr($junk,$dvd+2,$long-1);
print "<br><br>";
print "$vhs";

?>

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация