Jump to content

Search the Community

Showing results for tags 'strpos'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • W3Schools
    • General
    • Suggestions
    • Critiques
  • HTML Forums
    • HTML/XHTML
    • CSS
  • Browser Scripting
    • JavaScript
    • VBScript
  • Server Scripting
    • Web Servers
    • Version Control
    • SQL
    • ASP
    • PHP
    • .NET
    • ColdFusion
    • Java/JSP/J2EE
    • CGI
  • XML Forums
    • XML
    • XSLT/XSL-FO
    • Schema
    • Web Services
  • Multimedia
    • Multimedia
    • FLASH

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Languages

Found 2 results

  1. Here is my code: The code fails at line 36: $txt = substr($mtcontent, 0, strpos($mtcontent, "</title>")+7); <!DOCTYPE HTML><html><head> <meta charset="utf-8"> <title>Untitled Document</title> <style type="text/css"> body { margin:20px; padding:0; background-color:#0000FF; color:#FFFF00; } </style></head><body><h3>/* make a copy of the file to parse for assurance */</h3><br><?php copy("C:UsersownerDesktopPLUcodes.htm", "C:UsersownerDesktopworkfile.htm"); if(!file_exists("C:UsersownerDesktopworkfile.htm")) { die("File not found"); } else { echo "got copy"; }?><br><h3>/* get a file handel for the workfile */</h3><br><?php $myfile = fopen("C:UsersownerDesktopworkfile.htm", "r") or die("Unable to open file!");?><h3>/* copy content of workfile into a var, $mtcontent, for parsing */</h3><br><?php $mtcontent = fread($myfile,filesize("C:UsersownerDesktopworkfile.htm"));?><h3>/* we don't need the file workfile.htm open anymore, so close it using the file handel for that file */</h3><br><?php fclose($myfile);?><h3>/* get the content of our string from the first byte up to the closing title tag */</h3><br><h3>/* well put it in a varable called $txt */</h3><br><?php $txt = substr($mtcontent, 0, strpos($mtcontent, "</title>")+7); echo $txt;?><h3>/* then add the string litteral <head><body> to the end of our string */</h3><br><h3>/* have to use the HTML code for the grater and less than symbols, else won't work */</h3><br><?php $txt .= '<head><body>'?><h3>/* lets see what we have */<h3><br><?php echo $txt;?></body></html> I have tried using strpos($mtcontent, "<⁄title>") instead of strpos($mtcontent, "</title>") But that causes the page to render strangely wrong. At the end of the page, I want to echo the variable txt, but it appears to be empty.
  2. I’m getting that warning on this site :http://lottoholic.com/soccer/ I’ve gone into the ftp and cheched the file and nothing seems to be out of order, i even compaired the file to another CBPress installment on another website, it’s the same file, same syntax, no error on the other site either. i’m thinking about copying and pasting the code from the one site to the next. but i don’t want to really mess things up. can someone give some advice? here’s the code block. $new = array(); $chunks = $d; $chunks = str_replace(' and', '. and', $chunks); $chunks = str_replace(',', '.', $chunks); $chunks = str_replace('!', '.', $chunks); $chunks = explode('.',$chunks); $words = $this->get_word_filter_array(); foreach($chunks as $sentence) { $stop = 0; foreach($words as $word) { $pos = strpos(strtolower($sentence), strtolower($word)); if ($pos !== false) { $stop = 1; } } if(! $stop){ $new[] = $sentence; } } $new = implode('.',$new); $d = $new; if(trim($d) == '' || strlen(trim($d)) < 3){ $d = $this->title; } } so that’s the code. Line 1385 is the line above “foreach($word as $word) {” .. yeah thats right.. the blank one. class.prod.txt
×
×
  • Create New...