php array problem.
Posted: Sun Sep 05, 2010 6:08 am
i have to hide five characters from end of a variable called $url which stores url like this: http://piczasso.com/i/oqtb8ba.png%3C/a i have not to remove the same url or edit it in my database but have to print it till http://piczasso.com/i/oqtb8ba.png. for this i hace written this code(infact i did this in c++), which is not working please help!!:
Code: Select all
$url=$db_field['url'];
$count=0;
for($i=0;$url[$i]!='\n';$i++)
{
$count++;
}
$till=$count-5;
for($i=0;$i<=$till;$i++)
{
echo $url[$i];
}