If I echo out the result it works perfectly, but not when I try to get it to populate the input field. It always stops where the first quotation mark would occur (in other words, in the case above only '23' would be output) or just omits the whole variable totally. For the record, magic quotes is enabled if that has anything to do with it.
Can anyone shed some light on this? It seems such a simple thing but it's driving me nuts!