0
$photo[] = (string) $post->{'photo-caption'};
$photo_post[] = substr($photo,0,320);
$img[] = (string) $post->{'photo-url'};
if($pCount==$photoPosts)
for($i=0;$i<$photoPosts;$i++)
{
if(isset($img[$i]))
{
echo "<div style='width:518px;height:250px;border-bottom: 1px solid;'><div style='width:210px;height:200px;float:left;'>".'<img style="width:200px;height:200px;" src="' . $img[$i] . '" />'."</div><div style='width:300px;height:50px;float:right;'>".$photo_post[$i]."</div></div><br>";
}
}
$pCount=$pCount+1;
ここではsubstrは機能しません。私の写真のキャプションは表示されません。配列内でsubstrが機能しない
errormessageまたは間違った結果が「動作していない」とはどういう意味ですか? – Tobias
と$ photo []はなぜ配列ですか?それは単純な文字列を取得するように見える! – Tobias
PHPマニュアル(http://php.net/manual/en/function.substr.php)が表示されるはずです。文字列型データに使用されるsubstr関数 –