여기에 비슷한 질문이 많다는 것을 알고 있으며, 모두 읽었습니다. 내 문제는 내가 배열 목록을 통해 루프를 시도하고 각각에서 하나의 값을 잡아입니다. 배열은 제 3 자에 의해 설정되었으므로 수신 방법을 구성 할 수있는 권한이 없습니다. 여기에 내가 지금까지 가지고있는 것이있다 :배열 이름의 중괄호 변수, PHP
for ($i = 0; $i < $length; $i++) {
// Both of these work and return the value I need
echo $post->related_credits_0_related_show[0];
echo "{$post->related_credits_0_related_show[0]}"
// But none of these do, and I need to loop through a handful of arrays
echo "{$post->related_credits_{$i}_related_show[0]}";
echo "{$post->related_credits_${i}_related_show[0]}";
echo "{$post->related_credits_{${i}}_related_show[0]}";
echo "{$post->related_credits_".$i."_related_show[0]}";
}
내가 포함하지 않을 조합을 많이 (많은!) 시도했다. 또한 $ i를 문자열로 변환하려고 시도했습니다. 잠깐 머리를 두드렸다.
도움을 주셔서 미리 감사드립니다.
https://eval.in/135417 –