[FX.php List] Any body ever use pyfilemaker?

Steve Winter steve at bluecrocodile.co.nz
Thu Jan 19 07:46:00 MST 2012


Hi Troy

I'm not Dale, but I do know the answer… see http://php.net/manual/en/function.getopt.php

Then you can pass in things like 
	script.php -a transport -b truck

if in script.php you then set
	$args = getopt("a:b:")

$args will then be an array which has
	$args['a'] = transport
	$args['b'] = truck

HTH
Steve

> Dale,
> 
> Way back to this... how would you (can you?) pass arguments in for the PHP file to work on, from the command line? I tried $_SERVER['QUERY_STRING'] and the like with no luck.
> 
> -Troy
> 
> 
>> John, it's been a long time, but you handle including FX.php in the same
>> way you would in php from the web. Here's a very-simple example: Create
>> a php script called my_test.php. In it, put this:
>> 
>> <?php echo 'Hello world!'; ?>
>> 
>> Then go to Terminal and type
>> 
>> 	php path/to/my_test.php
>> 
>> … substituting the real path to your php script. You should see Hello
>> World! in your Terminal window. From there, you can branch out into
>> adapting FX.php calls to run the same way. All the rules apply -
>> includes, function calls, instantiating FX objects…. it's all the same.
>> It's just being run separate from Apache.
>> 
>> Dale
> 
> _______________________________________________
> FX.php_List mailing list
> FX.php_List at mail.iviking.org
> http://www.iviking.org/mailman/listinfo/fx.php_list

Steve Winter
+44 777 852 4776
steve at bluecrocodile.co.nz



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.iviking.org/pipermail/fx.php_list/attachments/20120119/bb05981a/attachment.html


More information about the FX.php_List mailing list