Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: Are these things possible?


cart3r
Member

@cart3r

Thanks! 1st and 3rd things are resolved.

I’ve been trying hundreds of different things/syntaxes to get the second item to work, but to no avail yet. I’m sure it must be the way I’m trying to code it (Full disclosure: I’m still trying to learn PHP).

What I’m going for is as follows:

Run the foreach, and then using array_shift(), grab the first item in the array, and then display just the post_text() that is contained within that array (assuming this is an array within an array)

This what my code (stripped down) looks like:

INITIAL POST:

<? php foreach ($posts as $bb_post) : $del_class = post_del_class(); ?>

<?

php array_shift();

echo post_text();

?>

<?php endforeach; ?>

=====================================

and then later on, when the responses are displayed:

<? php foreach ($posts as $bb_post) : $del_class = post_del_class(); ?>

<?php echo post_text(); ?>

<?php endforeach; ?>

I was hoping the first initial post wouldn’t be displayed since array_shift() would have taken it out?

Any help would be greatly appreciated…

Skip to toolbar