scbookz Posted August 2, 2009 Share Posted August 2, 2009 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. Quote Link to comment https://forums.phpfreaks.com/topic/168517-why-is-this-file_gets_contents-not-working/ Share on other sites More sharing options...
wildteen88 Posted August 2, 2009 Share Posted August 2, 2009 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. Quote Link to comment https://forums.phpfreaks.com/topic/168517-why-is-this-file_gets_contents-not-working/#findComment-888969 Share on other sites More sharing options...
scbookz Posted August 2, 2009 Author Share Posted August 2, 2009 i want to use the options so my code reads halfway down the page i am trying to start reading halfway down a page and skip some other stuff Quote Link to comment https://forums.phpfreaks.com/topic/168517-why-is-this-file_gets_contents-not-working/#findComment-888983 Share on other sites More sharing options...
scbookz Posted August 2, 2009 Author Share Posted August 2, 2009 thanks i am reading the link now on the manual i hope it helps me much appreciated Quote Link to comment https://forums.phpfreaks.com/topic/168517-why-is-this-file_gets_contents-not-working/#findComment-889005 Share on other sites More sharing options...
scbookz Posted August 2, 2009 Author Share Posted August 2, 2009 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 ( , , [ ] ) Quote Link to comment https://forums.phpfreaks.com/topic/168517-why-is-this-file_gets_contents-not-working/#findComment-889008 Share on other sites More sharing options...
wildteen88 Posted August 2, 2009 Share Posted August 2, 2009 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,) Quote Link to comment https://forums.phpfreaks.com/topic/168517-why-is-this-file_gets_contents-not-working/#findComment-889022 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.