PDA

View Full Version : convert PHP code to C



joukar
11-28-2003, 10:35 AM
Hi,
i've written a script that takes a total members and shows the sub totals ...
for example for the total {a,b} it shows {},{a},{b},{a,b} ...
i wanna run it stand alone somehow ... but i don't know how ! i mean how to execute a script in PHP as a Stand Alone application....

so i decided to convert my PHP code to C ...
but i am unfamiliar whit C and i faced some problems in finding correspond functions for explode , ereg_replace , trim , decbin .
I've written a function that act exactly like str_pad in PHP ...
but i couldn't write correspond functions to others ...
any help will be appreciated ...
thanks
Hamid

p.s : sorry for my poor English ! :-)

Nightfire
11-28-2003, 01:38 PM
I believe php gtk allows you to create stand alone applications. Not sure though

firepages
11-29-2003, 12:25 AM
c:\path\to\php.exe -q -f c:\path.script.php

saved as script.bat will run your code .. to see any output you will probably need to flush() ....

better still take a look at PEAR::console which will give you a lot more flexibility & the ability to interact with your app

even better still , as Nightfire suggests you can create GUI's via php-gtk though if you just want your script to mung some data and save it somewhere then I suggest the first option is best.

if php complains that it can't find something or other then be sure to copy your php4ts.dll to wherever your php.exe is.