2

Good day! I was trying to output a generated links from a given array and it was successful. The problem that confuses me is that when I try to click control print ( ctrl + P ) to print the page, it also shows the entire hyperlink, should i change my php code or is it done in html? and also i am using bootstrap 3. When i test other live pages it doesn't do that. What should I do? Thank you.

this is a snippet from my code

foreach($array as $key) {

    echo '<td ><a target="_blank" href="http://example.com/">'.$key.'</a></td>';

}

the preview in printer shows it like this:

1 ( http://example.com/ )
2 ( http://example.com/ )

what i need is only the plain text:

1
2
Meghan Lee
  • 63
  • 6

2 Answers2

1

I found an answer to my question but anyway thank you for all your opinions and suggestions. I appreciate it. It is a bootstrap issue and this link answers my problem.

@media print {
  a[href]:after {
    content: "";
  }
}

https://tracker.moodle.org/browse/MDL-40321

Meghan Lee
  • 63
  • 6
0

Try this:

<style type="text/css" media="print">
    @page 
    {
    a[href]::after {
    content: " (" attr(href) ")"
}
    }
</style>
Len_D
  • 1,422
  • 1
  • 12
  • 21