php - Dynamic keyword insertion -


i'm using code pass information url webpage.

mysite.com/?v=keyword  <a href="mysite.com/?<?php echo htmlspecialchars($_get['v']); ?>"></a> 

my problem need default keyword when traffic goes site , referring link not passing information url.

i need default keyword if no information passed. can me.

the default should set in php file. can use ternary operator based on isset(). if condition true, first value (after ?) used, if condition false, second value (after :) used.

$keyword = (isset($_get['v'])) ? $_get['v'] : 'default'; 

this equivalent to:

if (isset($_get['v'])) {    $keyword = $_get['v']; } else {    $keyword = 'default'; }