Jump to content

[SOLVED] Question marks in code.


bundyxc

Recommended Posts

So I was on another thread, and I saw this line of code:

 

echo ($page > 1) ? '<a href="?page=' . ($page - 1) . (strlen($search) ? '&search=' . $search : '') .'">prev</a> ' : 'prev ';

 

Anyway, could somebody explain what relevance the first and last question marks have in this line of code? Obviously the middle question mark is passing a HTTP GET request onto the linked page, but I don't understand the question marks (or the colon at the end, either). Thanks for your time.

Link to comment
https://forums.phpfreaks.com/topic/173499-solved-question-marks-in-code/
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.