Reputation: 49
I am trying to create a link within a text, I have 2 columns in my table (updates1) and (link1) updates 1 contains a text while link 1 contains a link. The problem is whenever im trying to call it the data or the link itself is being an output besides the text. I need it to be stored inside the text.
echo "<b><h4>{$list["updates1"]}<a>{$list["link1"]}</a></b></h4><hr>";
Upvotes: 0
Views: 43
Reputation: 5401
Try this:
echo '<b><h4><a href="'.$list["link1"].'">'.$list["updates1"].'</a></h4></b><hr>';
As per OP's example in the comment:
echo '<b><h4><a href="upload/'.$list["link1"].'" target=_"blank">'.$list["updates1"].'</a></b></h4><hr>';
Upvotes: 2
Reputation: 175
you can also try it using "\"
echo "<b><h4><a href=\"{$list['link1']}\"> {$list['updates1']}</a></h4></b><hr>";
Upvotes: 1
Reputation: 525
in php you can go through
echo "<b><h4><a href='".$list["link1"]."'>".$list['updates1']."</a></b></h4><hr>";
Upvotes: 1
Reputation: 766
echo "<b><h4>{$list['updates1']}<a href=\"{$list['link1']}\"> Your Link Title</a></h4></b><hr>";
EDIT: Try to close proper way tag
Upvotes: 1
Reputation: 691
Close the <h4>
tag before the <b>
tag, like this:
echo "<b><h4>{$list["updates1"]}<a>{$list["link1"]}</a></h4></b><hr>";
Upvotes: 1