Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Nov 2003
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    convert PHP code to C

    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 ! :-)

  • #2
    Senior Coder Nightfire's Avatar
    Join Date
    Jun 2002
    Posts
    4,265
    Thanks
    6
    Thanked 48 Times in 48 Posts
    I believe php gtk allows you to create stand alone applications. Not sure though

  • #3
    Super Moderator
    Join Date
    May 2002
    Location
    Perth Australia
    Posts
    4,108
    Thanks
    11
    Thanked 101 Times in 99 Posts
    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.
    resistance is...

    MVC is the current buzz in web application architectures. It comes from event-driven desktop application design and doesn't fit into web application design very well. But luckily nobody really knows what MVC means, so we can call our presentation layer separation mechanism MVC and move on. (Rasmus Lerdorf)


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •