We help IT Professionals succeed at work.

Is there any way to execute PHP script in VB.NET without a webserver

WPCap
WPCap asked
on
Hi there, people. I want to know if there is any way to execute PHP code using VB.NET without having a webserver.
Comment
Watch Question

Author

Commented:
I downloaded php for windows (binaries)

http://www.php.net/manual/en/features.commandline.usage.php

How do I combine this with vb.net?

Let's say I have example.php with script that needs to be executed:

 
<?php
function hexToStr($hex)
{
    $string='';
    for ($i=0; $i < strlen($hex)-1; $i+=2)
    {
        $string .= chr(hexdec($hex[$i].$hex[$i+1]));
    }
    return $string;
}
$hexstr = $_GET['hexstr'];

echo hexToStr($hexstr);

?>

Open in new window


How do I pass $hexstr variable to PHP via command line? and how do I read the output?
Most Valuable Expert 2012
Top Expert 2014
Commented:
I think if you focus on getting the code working in VB.NET, that would be easier for you in the longer term.

Author

Commented:
yea :)