Jump to content

PHP ending code help?


Hyun

Recommended Posts

Hello everyone!

 

So, my friend coded this PHP code (SSI.php for SMF recent news function) for me:

 

<?php

			$array = ssi_boardNews(2, 5, null, 2000, 'array');

			foreach($array as $post) {
  				echo '   <h4>', $post['subject'], '</h4>
    				<h2>Posted by ', $post['poster']['link'], ' at ', date('G:i \o\n l, F j, Y', $post['timestamp']), '</h2>
    				<p>', $post['body'], '</p>
			', $post['comment_link'];
			}

			?>

 

I wanted to edit how the comment link looks so I edited it to this:

<?php

			$array = ssi_boardNews(2, 5, null, 2000, 'array');

			foreach($array as $post) {
  				echo '   <h4>', $post['subject'], '</h4>
    				<h2>Posted by ', $post['poster']['link'], ' at ', date('G:i \o\n l, F j, Y', $post['timestamp']), '</h2>
    				<p>', $post['body'], '</p>
			<h2>', $post['comment_link'], '</h2>;
			}

			?>

 

But when I do this, I get an error.

Warning: Unexpected character in input: ''' (ASCII=39) state=1 in /.../public_html/index.php on line 49

Parse error: syntax error, unexpected '<' in /.../public_html/index.php on line 49

 

How would I go about fixing this? I also want to add a horizontal rule after each post. Does anyone know how to add it?

 

Thanks.

Link to comment
https://forums.phpfreaks.com/topic/175576-php-ending-code-help/
Share on other sites

i really like this programming method of the array..

 

 

someone please explain it?

 

      $array = ssi_boardNews(2, 5, null, 2000, 'array'); <<< it a function to set

internal values UNDERSTAND THAT.

 

BUT

 

foreach as $post now, but the $array variable not $array[] format?

 

how can the function of ssi_boardNews let variable $array become a array

Link to comment
https://forums.phpfreaks.com/topic/175576-php-ending-code-help/#findComment-925227
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.