HI
I am new to php
I would like to ask how I can insert a C source code into a php file
please help
I have a C scheduling algorithm that I'd like to use for my site that I am developing using php/mysql but I don't know how.

Please help

Recommended Answers

All 5 Replies

Simple answer: Your algo needs to be ported to PHP. There is no way to implement C/C++ code into a php file.

The only way this works would be writing an extension for PHP. This extension is loaded by the php engine and provides your functionality under special function names.

Have a look at http://www.php.net and the PECL or PEAR subsites.

Member Avatar for iamthwee

WHy don't you post your c algo here. I'd bet I could port it to php.

http://www.devnewz.com/2002/0909.html

This is a nice "how to" for adding your own libraries using windows. Linux shouldn't be a problem as well, if you know about C/C++ programming on different platforms.

That is the scheduling code,
I 'd really appreciate your help.
Actually I need to do scheduling for a number of teams in the mysql database.

Member Avatar for iamthwee

That is the scheduling code,
I 'd really appreciate your help.
Actually I need to do scheduling for a number of teams in the mysql database.

That looks simple enough. The only problem I can see is with that struct.

But I suppose you use use a class instead or take it out altogether.

Passing functions, again that should be simple to do.

And those bitwise operators, thankfully php supports that as well:

http://www.hudzilla.org/php/3_12_3.php


Have a go and see how far you get.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.