Jump to content

why is this file_gets_contents not working?


scbookz

Recommended Posts

php manual  makes no sense to me they use  complicated wording why not say it in laymen terms?

--------------------------

$flag = "http://"

$oscfile = file_get_contents("http://cc.cc.cc.cc:81/osc/osc/osc/catalog/product_info.php?products_id",$flag,$offset=-1,$maxlen=-1);

$osc = (get_oscdoc_title($oscfile));

$test = $osc;

-----------------------------------------------------------------------------------------

 

Description

string file_get_contents ( string $filename [, int $flags= 0 [, resource $context [, int $offset= -1 [, int $maxlen= -1 ]]]] )

 

This function is similar to file(), except that file_get_contents() returns the file in a string, starting at the specified offset up to maxlen bytes. On failure, file_get_contents() will return FALSE.

 

file_get_contents() is the preferred way to read the contents of a file into a string. It will use memory mapping techniques if supported by your OS to enhance performance.

parameters wrapped in square brackets are optional.

 

In your case all you'll need to do is

$oscfile = file_get_contents("http://cc.cc.cc.cc:81/osc/osc/osc/catalog/product_info.php?products_id");

 

Personally I find the manual easy to read. One of the best around. However if you're struggling to read the manual have a read of this.

here is a good example

(  ,  [,  ] )

 

those commas dont make normal common sense the way they are arranged

i am a math man and that dont line up they are not clear at all here

----------------------------------------------------------------------

Many functions take on multiple parameters, such as in_array(). Its prototype is as follows:

 

      bool in_array ( mixed $needle, array $haystack [, bool $strict])

 

--------------------------------------------------

they way it should read  it seems is

 

( , , [ ] )

 

No not all. As I mentioned earlier everything in square brackets is optional, ie not required.

 

If the format for calling the function was this

( , , [ ] )

 

Then it'll make function calls ugly and confusing.

in_array($needle, $haystack,)

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.