How to create simpliest PHP Get API with UTF-8 support?

Posted by Ole Jak on Stack Overflow See other posts from Stack Overflow or by Ole Jak
Published on 2010-05-13T22:32:43Z Indexed on 2010/05/13 22:34 UTC
Read the original article Hit count: 134

Filed under:
|
|
|
|

How to create simpliest *(less lines of code, less strange words) PHP Get API *(so any programm made in .Net C# could call url like http://localhost/api.php?astring=your_utf-8_string&bstring=your_utf-8_string ) with UTF-8 support?

What I need Is PHP API with one function - concatinate 2 strings so that a simple .net client like this would be able to use it:

    public string setStream(string astring, string bstring)
    {
string newAstring =Uri.EscapeDataString(astring);
string newBstring = Uri.EscapeDataString(bstring);
        WebClient client = new WebClient();
        var result = client.DownloadString(("http://localhost/api.php?" + string.Format("astring={0}&bstring={1}", newAstring, newBstring)).ToString());
        return result;
    }

© Stack Overflow or respective owner

Related posts about .NET

Related posts about php