Jump to content

Recommended Posts

I am getting:

Parse error: parse error, unexpected T_STRING in /home/content/t/c/p/tcpalmer/html/test.php on line 3

 

Note I changed the find string to what I will actually be searching for on a different page.

 

<?php
$html = file_get_contents("http://xkcd.com/663/");
$find = "<TD CLASS="dddefault">0</TD>";
if(stripos($html,$find) !== false){
   echo "found";
}

 

I think it is because of the other quotation marks in the string I am searching for.

 

The syntax highlighting of the forum shows up your problem. You are trying to use a double quotes in a string that is delimited (started and ended) with a double quote. You will need to either escape them or change the delimiters to single quotes....

 

$find = "<TD CLASS=\"dddefault\">0</TD>";
// or
$find = '<TD CLASS="dddefault">0</TD>';

Thank you guys both for your help so far.

 

Earlier the function stripos worked, now it doesn't so I replaced it with strpos.

 

Earlier file_get_contents for the https page, but now that is not working either.  You do not have to be logged into anything to access this https page.

 

Any ideas?  I checked with my hosting provider and they didn't do anything.  I am running PHP version 4.x

Well it was announced late 2005, and yet theirs no release date (that i know of)

a few things to keep in-mind, when developing (don't rely on magic_quotes or register_globals and update ereg's to preg's

here is a list of changes in PHP6

  • magic_quotes, register_globals, register_long_arrays,safe_mode are all removed YAY
  • removed ereg (update to preg people)
  • Improved Unicode support
  • Namespaces (well that's now in 5.30)

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.