[PHP] Variable representation

2012-06-21 Thread Ron Piggott
I am trying to represent the variable: $row['Bible_knowledge_phrase_solver_game_question_topics_1'] Where the # 1 is replaced by a variable --- $i The following code executes without an error, but “Hello world” doesn’t show on the screen. ?php

RE: [PHP] Variable representation

2012-06-21 Thread admin
-Original Message- From: Ron Piggott [mailto:ron.pigg...@actsministries.org] Sent: Thursday, June 21, 2012 3:47 AM To: php-general@lists.php.net Subject: [PHP] Variable representation I am trying to represent the variable: $row['Bible_knowledge_phrase_solver_game_question_topics_1']

Re: [PHP] Variable representation

2012-06-21 Thread As'ad Djamalilleil
or you can do this echo $row[Bible_knowledge_phrase_solver_game_question_topics_$i];

[PHP] why is (intval('444-44444') == '444-44444') EQUAL??!

2012-06-21 Thread Daevid Vincent
Huh? Why is this equal??! php $id = '444-4'; php var_dump($id, intval($id)); string(9) 444-4 int(444) php if (intval($id) == $id) echo 'equal'; else echo 'not equal'; equal or in other words: php if (intval('444-4') ==

Re: [PHP] why is (intval('444-44444') == '444-44444') EQUAL??!

2012-06-21 Thread Robert Cummings
On 12-06-21 10:27 PM, Daevid Vincent wrote: Huh? Why is this equal??! php $id = '444-4'; php var_dump($id, intval($id)); string(9) 444-4 int(444) php if (intval($id) == $id) echo 'equal'; else echo 'not equal'; equal or in other

Re: [PHP] why is (intval('444-44444') == '444-44444') EQUAL??!

2012-06-21 Thread Mike Mackintosh
Using == will compare the two values after type juggling is performed. === will compare based on value and type (identical). PHP Will type juggle the string to an integer. Your if/else is just like saying: php if (444 == 444) echo 'equal'; else echo 'not equal'; equal -- Mike Mackintosh PHP