944,135 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 3284
  • PHP RSS
Jul 22nd, 2006
0

C code into php

Expand Post »
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
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
angelv is offline Offline
3 posts
since Jul 2006
Jul 22nd, 2006
0

Re: C code into php

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.
Reputation Points: 11
Solved Threads: 0
Newbie Poster
Rotak is offline Offline
19 posts
since May 2005
Jul 22nd, 2006
0

Re: C code into php

WHy don't you post your c algo here. I'd bet I could port it to php.
Featured Poster
Reputation Points: 1536
Solved Threads: 431
Posting Expert
iamthwee is offline Offline
5,865 posts
since Aug 2005
Jul 22nd, 2006
0

Re: C code into 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.
Reputation Points: 11
Solved Threads: 0
Newbie Poster
Rotak is offline Offline
19 posts
since May 2005
Jul 23rd, 2006
0

Re: C code into php

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.
Attached Files
File Type: c scheduling.c (4.5 KB, 75 views)
Reputation Points: 10
Solved Threads: 0
Newbie Poster
angelv is offline Offline
3 posts
since Jul 2006
Jul 23rd, 2006
0

Re: C code into php

Quote originally posted by angelv ...
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.
Featured Poster
Reputation Points: 1536
Solved Threads: 431
Posting Expert
iamthwee is offline Offline
5,865 posts
since Aug 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: new PHP user - help
Next Thread in PHP Forum Timeline: passing checkbox value to next page





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC