변수로 ID를 변경하는 동적 인 분할을 만들려고합니다. 이 외에도 dvision은 팝업입니다. 부서는 데이터베이스에서 정보를 가져 오기 때문에 고유해야합니다. 그동안 루프는 아무것도하지 않는 몇 가지 이유를 들어php while 루프는 변수를 비교하지 않습니다.
<?php
$index_map = 4; //this variable is already defined in other part of the document.
//It is just here to specify its value to the readers
$index_data = 1;
while($index_data = $index_map)
{
echo '
<div data-role="popup" id="mapdata'.$index_data.'" class="ui-content" data-theme="d">
<img class="popphoto" src="style/2nd_floor.png"
style="max-height:512px;" alt="Parking_Lot_Map1">
'.$index_data.'
</div>
';
$index_data++;
}
?>
, 그 후 다른 HTML 데이터를 표시하지 않습니다 : 내가 지금까지 가지고하는 것은 이것이다. 이것은 다른 .php 파일에 포함 된 PHP 문서입니다. while 루프가 어떤 변수를
인식 않는 이유는=
세트,
==
는 비교 때문에
'$ index_data == $ index_map'은 double 같음 –
'$ index_data'는 매 반복마다 항상 '4'값으로 설정 될 것입니다. '4'는 진리로 평가 될 것이기 때문에 무한 루프가됩니다. –