rawurlencode and sprintf
Posted: Mon Oct 17, 2005 8:05 am
ok my boss insists on using sprintf for this part. here is what i got
problem is that $name is going to have ' & ' without the quotes in it somtimes. that blows up things. i tried using rawurlencode($name) and it returns the error, too few arguments for sprintf and im like die! then i tried just
but for some reason or whatever it goes from WORD & OTHER to WORDamp; OTHER and im like WTF! then i did replace on the amp; and then back respectivly but this is all turning out to give me no results. any ideas? this makes no sence to me why its going crazy
edit:
when i don't do any str_replaces then the url is WORD%20&%20OTHER ok well no problem just str_replace the %20's to spaces right? well when i try that it just leaves me with the 1st word and deletes the rest of it so it just turns to WORD. WTF!
Code: Select all
sprintf ('<li><a %s href="index.php?id=%s&p='.$name.'">%s</a>'Code: Select all
str_replace(' &', 'AAA', $name);
//then back again respectivlyedit:
when i don't do any str_replaces then the url is WORD%20&%20OTHER ok well no problem just str_replace the %20's to spaces right? well when i try that it just leaves me with the 1st word and deletes the rest of it so it just turns to WORD. WTF!