<?php
function gene($arr, $n, $str) { //or gene($arr, $n, &$str)?
if ($n == 0) {
show($str); //$str is array
echo "</br>";
return 0;
}
$len = count($arr);
for($i=0; $i<$len; $i++) {
$str[$n] = $arr[$i];
gene($arr, $n-1, $str);
}
} function show($arr) {
foreach($arr as $val)
echo $val;
}
$arr = array('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0'); //the letters
$str = '';
gene($arr, 3, $str);
?>这上面是一段生成字符串的代码,我想让每隔10行就输出一张图片,应该怎么写呢,谢谢
function gene($arr, $n, $str) { //or gene($arr, $n, &$str)?
if ($n == 0) {
show($str); //$str is array
echo "</br>";
return 0;
}
$len = count($arr);
for($i=0; $i<$len; $i++) {
$str[$n] = $arr[$i];
gene($arr, $n-1, $str);
}
} function show($arr) {
foreach($arr as $val)
echo $val;
}
$arr = array('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0'); //the letters
$str = '';
gene($arr, 3, $str);
?>这上面是一段生成字符串的代码,我想让每隔10行就输出一张图片,应该怎么写呢,谢谢
---------------------------------------
for($i=0;$i<10;$i++){ echo '<br/>';}
sorry, that method is not good,
you would be output the string "<br><br><br><br><br>.." for 10 lines and show your
pictures.