scbookz Posted August 4, 2009 Share Posted August 4, 2009 all i want to do is grab one variable not the whole script from another file includes will take the whole script and wget will read whole file i just want to take a variable out of one file as it is called and use it in another file this aught to be easy as cake does any one have an idea? Quote Link to comment https://forums.phpfreaks.com/topic/168741-why-is-this-so-complicated/ Share on other sites More sharing options...
scbookz Posted August 4, 2009 Author Share Posted August 4, 2009 nevermind maybe this is my answer ---------------------- Description string urlencode ( string $str ) This function is convenient when encoding a string to be used in a query part of a URL, as a convenient way to pass variables to the next page. Quote Link to comment https://forums.phpfreaks.com/topic/168741-why-is-this-so-complicated/#findComment-890267 Share on other sites More sharing options...
o3d Posted August 4, 2009 Share Posted August 4, 2009 open the file and read the file line by line searching for the variable name, once found, capture the variable and its value and close the file. Quote Link to comment https://forums.phpfreaks.com/topic/168741-why-is-this-so-complicated/#findComment-890269 Share on other sites More sharing options...
br3nn4n Posted August 4, 2009 Share Posted August 4, 2009 file_get_contents() or fopen() then a foreach (to loop through the lines) and look for the variable with an else if. Quote Link to comment https://forums.phpfreaks.com/topic/168741-why-is-this-so-complicated/#findComment-890287 Share on other sites More sharing options...
rameshfaj Posted August 4, 2009 Share Posted August 4, 2009 Yes I think file_get_contents() or fopen() should help you in solving your problem, if not then please let us know. Quote Link to comment https://forums.phpfreaks.com/topic/168741-why-is-this-so-complicated/#findComment-890346 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.