Tag : Foreach


How to use foreach object in Nodejs ?

Normally, we does use foreach loop in PHP, JS etc, but when i was working on socket programming at that time i require to use foreach of object in server.js. I did also search on google and try to how to use foreach in Node JS. At last i found to use forEach and solve it. so, let's see following example. <strong >Example</strong> <pre class="prettyprint lang-php"> socket.on("newmessage", function(obj) { obj = JSON.parse(obj); obj.forEach(function(items) { console.log(items.userid); var e = "notify-"+items.userid; io.sockets.emit(e, 1); }); }); </pre>

By Hardik Savani | March 31, 2016 | | 1390 Viewer | Category : PHP Laravel Node JS
READ MORE

    CRUD (Create Read Update Delete) Example in Laravel 5.2 from Scratch

    CRUD (Create Read Update Delete) Example in Laravel 5.2 from Scratch

    Open Post

    AngularJS - simple image upload with preview example in PHP

    AngularJS - simple image upload with preview example in PHP

    Open Post

    Bootstrap - Jquery multiple select with checkboxes example using bootstrap-multiselect.js plugin

    Bootstrap - Jquery multiple select with checkboxes example using bootstrap-multiselect.js plugin

    Open Post

    Laravel 5 create Custom Validation Rule example.

    Laravel 5 create Custom Validation Rule example.

    Open Post

    Laravel - How to search with comma separated values using Query Builder ?

    Laravel - How to search with comma separated values using Query Builder ?

    Open Post

    Laravel 5 - How to create custom error page with example

    Laravel 5 - How to create custom error page with example

    Open Post