2011-11-25 2 views
0

PHP를 잘 이해하지 못합니다 ... 잘 알지 못합니다.mobile_device_detect가 true 인 경우 php 조건문

저는 모바일/데스크톱 웹 사이트에 http://detectmobilebrowsers.mobi/을 사용하고 있으며, 저는 CMS로 wordpress를 사용하고 있습니다. 내가 지금처럼 내 기능을 설정 한

...

require_once('mobile_device_detect.php'); 
    mobile_device_detect(true,true,true,true,true,true,false,false,false); 

하지만 지금 내 주제에, 나는이 비슷한 조건문을 원하는

...

<?php if (is_home()) { ?> 

     //Some bits here 
    <?php } else { ?> 
     //Some bits here 
    <?php } ?> 

내가 원하는 있지만 내 함수에서 값을 반환합니다.

<?php if (mobile_device_detect==true) { ?> 

     //Some bits here 
    <?php } else { ?> 
     //Some bits here 
    <?php } ?> 

분명히이 롤 작동하지 않을 ... 아래에있는 내 쓰레기 시도 아래 참조,하지만 당신은 내가 달성하기 위해 노력하고있어 볼 수 있습니까? 그리고 도움이 가장 멋진 감사가 될 것입니다! 거의가

건배 조쉬

+1

을 확인하지만, 그'detectmobilebrowsers' 웹 사이트에서 "지금 주문"버튼의 말도 안되는 숫자에 의해 놀라 울뿐입니다! – Roman

+0

하하 정신은 그렇지 않다 – Joshc

답변

1

.

require_once('php/mobile_device_detect.php'); 
$mobile = mobile_device_detect(true,true,true,true,true,true,false,false,false); 

그런 다음

if ($mobile==true) // then do the rest of your stuff 
나는 아무 대답이 없어 한
+0

당신의 Gent, 고마워요 !!! – Joshc

관련 문제