This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Use whatever method you like to grab your HTML string. We'll use a site I mentioned in this post | |
| * as an example. | |
| */ | |
| $remote_site_data = file_get_contents('http://www.10stripe.com/articles/automatically-generate-table-of-contents-php.php'); | |
| $dom_document = new DomDocument(); | |
| @$dom_document->loadHTML($remote_site_data); | |
| $headers = $dom_document->getElementsByTagName('h2'); | |
| foreach ($headers as $header) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $url="http://thehilolowdown.blogspot.com/feeds/posts/default?max-results=1"; | |
| $_c = curl_init(); | |
| curl_setopt($_c, CURLOPT_URL, $url); | |
| curl_setopt($_c, CURLOPT_RETURNTRANSFER, 1); | |
| curl_setopt($_c, CURLOPT_TIMEOUT, 3); | |
| //curl_setopt($_c, CURLOPT_USERPWD, "$_user:$_pass"); | |
| //curl_setopt($_c, CURLOPT_HTTPAUTH, CURLAUTH_BASIC); | |
| $_data = curl_exec($_c); | |
| $response= curl_getinfo($_c); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Adding Cache Headers and ETag to example: http://sperling.com/examples/pcss/ | |
| */ | |
| class PHPStyle | |
| { | |
| public static function setHeaders($filename="style.css",$type="text/css") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <html> | |
| <head> | |
| <script type="text/javascript"> | |
| //<[CDATA[ | |
| window.addEvent('domready', function(){ | |
| // onload functions here | |
| }); | |
| function overlay() { | |
| el = document.getElementById("overlay"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // set location of docx text content file | |
| $xmlFile = $targetDir."/word/document.xml"; | |
| $reader = new XMLReader; | |
| $reader->open($xmlFile); | |
| // set up variables for formatting | |
| $text = ''; $formatting['bold'] = 'closed'; $formatting['italic'] = 'closed'; $formatting['underline'] = 'closed'; $formatting['header'] = 0; | |
| // loop through docx xml dom | |
| while ($reader->read()){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // set location of docx text content file | |
| $xmlFile = $targetDir."/word/document.xml"; | |
| $reader = new XMLReader; | |
| $reader->open($xmlFile); | |
| // set up variables for formatting | |
| $text = ''; $formatting['bold'] = 'closed'; $formatting['italic'] = 'closed'; $formatting['underline'] = 'closed'; $formatting['header'] = 0; | |
| // loop through docx xml dom | |
| while ($reader->read()){ |