Number from $_GET not being read into simplexml xpath query using php?

$number=$_GETthenumber; At this stage $number is a string. Do you need to coerce it into an integer? Probably with intval?

php.net/manual/en/function.intval.php.

Thanks Mark! Despite agonising over this for 2hours, about 2 minutes after posting I suddenly recalled my FORTRAN days and the way one needs to declare variables! – Morph Jul 18 at 13:24.

Yep, thanks Shane. Sorry for schoolboy questions. Am new to PHP ... I recalled my FORTRAN days and remembered one needs to declare variables as a type.

Intval or (int) doe the trick :) Thaks fo rthe quick response – Morph Jul 18 at 13:27.

PHP should convert your "2" to a 2 without a problem. My guess is that you're missing quotes: $number=$_GETthenumber. Try $number=$_GET'thenumber'.

I am afraid the quotes did not solve the problem (I tried single and double quotes first). The trick was declare $_GETthenumber as an integer value thus : intval($_GETthenumber). Thanks anyway – Morph Jul 18 at 14:53.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions