echo "<td><a href='/item/$cat/$show[id]/'>$titleprod</a></td>";
Displays this: http://www.domain.com/category/2/item//2/383/
Notice the extra "/" after item? How do I get rid of that?
Thanks.
1.) It's not an echo issue
2.) hard to tell with the code you gave.
What are the variables contents?
use substr and remove the last '/' from $show[id]
While that would fix it, it's not a solution. THe variable itself has something wrong with it, and if it's in a database, or if it's not the same across all the variables, you'll come up with errors....
There's two thing wrong with referencing $show[id] inside of a string:
That's not the proper way to point to an index of an associate array; indeces are strings. You didn't give a string, you gave a constant which I'm willing to get money you didn't create.
While you can go up to one dimension deep in an array within a string it seems... don't. The PHP manual says not to, so it's a good idea to listen to it. Either surround the array reference in braces ( {} ) or just concatenate it onto the string pieces.
Also, try echo'ing $cat. Does it have a slash in it?