Search Results

Search found 3 results on 1 pages for 'domagoj412'.

Page 1/1 | 1 

  • Non ASCII char in PHP?

    - by domagoj412
    Hello, I am trying to send something to serial port (r232) with PHP. I am using this class: http://www.phpclasses.org/browse/package/3679.html The problem is that I am allowed to send only 1 byte. But if I send something like "1", I am actually sending 49 (ASCII for 1). Instead of send("1"), I tried with send(1) but it is no good, because this is integer which has 2 bytes. So is there a way to send a "real" char, not ASCII equivalent?

    Read the article

  • Getting JSON data in PHP

    - by domagoj412
    I have a JSON data like this: { "hello": { "first":"firstvalue", "second":"secondvalue" }, "hello2": { "first2":"firstvalue2", "second2":"secondvalue2" } } I know how to retrieve data from object "first" (firstvalue) and second (secondvalue) but I would like to loop trough this object and as a result get values: "hello" and "hello2"... This is my PHP code: <?php $jsonData='{"hello":{"first":"firstvalue","second":"secondvalue"},""hello2":{"first2":"firstvalue2","second2":"secondvalue2"}}'; $jsonData=stripslashes($jsonData); $obj = json_decode($jsonData); echo $obj->{"hello"}->{"first"}; //result: "firstvalue" ?> Can it be done?

    Read the article

  • How do I dynamically load a js file using Prototype?

    - by domagoj412
    Hello, I am using prototype to load external js file (actually it is php file) dynamically. Like this: function UpdateJS(file) { var url = 'main_js.php?file='+file; var myAjax = new Ajax.Request( url, {method: 'get', onComplete: showResponseHeader} ); } function showResponseHeader (originalRequest) { $('jscode').innerHTML = originalRequest.responseText; } Container "jscode" is defined like this: <script type="text/javascript" id="jscode"></script> And it works! But if some different file is called, all the functions from previous one are preserved. And I don't want that. Anybody knows how to "unload" first js file when second one is called? (I also tried using Ajax.Updater function but the result is the same.) Update: It turns out that there is bigger problem: it only loads if function "UpdateJS" is in window.onload that is why it doesn't load anything else after that. So prototypes update it's maybe not such a good way for this...

    Read the article

1