I have a link:
http://www.site.com?something=thisismystring
now:
$bd=$_GET['something'];
$c=3;
echo $bd{$c};
Now when I try that, i get the forth char printed on screen, not the third, so then i try to add one up on $c to just check I’m doing it right ($c=4). And again, that returns the 5th char of the string when it should return the 4th….
I know this is something i’m doing wrong, but i cannot figure out what.
all help is much appreciated.
thanks
Nav,
The array starts at 0.
So for your example:
http://www.site.com?something=thisismystring
$bd=$_GET[‘something’];
$c=0;
echo $bd{$c};
That would print out the letter t (first character of the string).