Webprogrammierung

Javascript – Copy div text to clipboard

Here’s a Javascript function, which copies the text from a div to the own clipboard for copy & paste: <button onclick=“CopyToClipboard(‚text‘)“>Copy text</button> <script> function CopyToClipboard(containerid) { if (document.selection) { var range = document.body.createTextRange(); range.moveToElementText(document.getElementById(containerid)); range.select().createTextRange(); document.execCommand(„copy“); } else if (window.getSelection) …

Javascript – Copy div text to clipboard Weiterlesen »

simple_html_dom – file_get_html empty

With simple_html_dom you can parse HTML in PHP. My file_get_html variable was empty and that was the problem: define(‚MAX_FILE_SIZE‘, 900000); Max filesize was too low. After i have increased the value in simple_html_dom.php everything worked fine.

Yahoo Finance API Alternative – Nachbau in PHP

Da die Yahoo Finance API leider eingestellt wurde, habe ich mir kurzerhand ein alternatives PHP Skript gebastelt um den aktuellen Kurs eines Wertes abzufragen. Codeschnipsel zum eigenen Nachbau $symbol = $rowstocks[’symbol‘]; $url = „https://de.finance.yahoo.com/quote/“.$symbol; $ch = curl_init(); $timeout = 5; …

Yahoo Finance API Alternative – Nachbau in PHP Weiterlesen »

Scroll to Top