echo 수 더하기 질문입니다. 채택완료
그냥 아래소스로 하면 숫자 10개만 출력 됩니다. 그 숫자를 더한값(합한값) 으로 나타낼수 있나요? 도와주세요^^
$_conf__url = array();
$_conf__url[] = "http://도메인1.com/test.php" ;
$_conf__url[] = "http://도메인2.com/test.php" ;
$_conf__url[] = "http://도메인3.com/test.php" ;
$_conf__url[] = "http://도메인4.com/test.php" ;
$_conf__url[] = "http://도메인5.com/test.php" ;
$_conf__url[] = "http://도메인6.com/test.php" ;
$_conf__url[] = "http://도메인7.com/test.php" ;
$_conf__url[] = "http://도메인8.com/test.php" ;
$_conf__url[] = "http://도메인9.com/test.php" ;
$_conf__url[] = "http://도메인10.com/test.php" ;
$cnt=count($_conf__url);
$resultset=array();
for( $i = 0; $i < $cnt; $i++ ){
$url = $_conf__url[$i];
ini_set("allow_url_fopen", 1);
echo $resultset[$url] = file_get_contents($url);
}
?>
답변 7개
<?php$thisArray = array(1,2,3,4,5,6,7,8,9,10);foreach($thisArray AS $item => $val){ $vals = $vals+$val; echo("배열번호 : ".$item." 배열값 : ".$val." ---- Is this Domain? http://www.domain".$vals.".com/test.php<br />");} ?>
댓글을 작성하려면 로그인이 필요합니다.
댓글을 작성하려면 로그인이 필요합니다.
지금 보여드린 소스는 그숫자를 나열하는 소스이죠?
댓글을 작성하려면 로그인이 필요합니다.
echo $sum;
댓글을 작성하려면 로그인이 필요합니다.
<?
$_conf__url = array();
$_conf__url[] = "http://도메인1.com/test.php" ;
$_conf__url[] = "http://도메인2.com/test.php" ;
$_conf__url[] = "http://도메인3.com/test.php" ;
$_conf__url[] = "http://도메인4.com/test.php" ;
$_conf__url[] = "http://도메인5.com/test.php" ;
$_conf__url[] = "http://도메인6.com/test.php" ;
$_conf__url[] = "http://도메인7.com/test.php" ;
$_conf__url[] = "http://도메인8.com/test.php" ;
$_conf__url[] = "http://도메인9.com/test.php" ;
$_conf__url[] = "http://도메인10.com/test.php" ;
$cnt=count($_conf__url);
$resultset=array();
for( $i = 0; $i < $cnt; $i++ ){
$url = $_conf__url[$i];
ini_set("allow_url_fopen", 1);
echo $resultset[$url] = file_get_contents($url);
}
?>
-------------------------------------출력화면-----------------
1000
이렇게 http://도메인(1~10).com/test.php 이페이지안에 있는 숫자값이 출력됩니다. 여기서 출력화면에 표시된 숫자를 다 더하고 싶은거에요^^
댓글을 작성하려면 로그인이 필요합니다.
이게 뭔말인가요?
질문을 좀 더 상세히 그리고 요점을 집어서 질문해주세요
댓글을 작성하려면 로그인이 필요합니다.
댓글을 작성하려면 로그인이 필요합니다.
답변을 작성하려면 로그인이 필요합니다.
로그인