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 | | 3764 Viewer | Category : PHP Laravel Node JS
READ MORE

    How to create custom scrollbar using jquery mcustomscrollbar plugin ?

    How to create custom scrollbar using jquery mcustomscrollbar plugin ?

    Open Post

    How to get gravatar image from email using Jquery?

    How to get gravatar image from email using Jquery?

    Open Post

    Laravel 5 - Paypal Payment Integration example using netshell/paypal package from scratch

    Laravel 5 - Paypal Payment Integration example using netshell/paypal package from scratch

    Open Post

    Codeigniter 3 - CRUD(Create, Read, Update and Delete) using JQuery Ajax, Bootstrap, Models and MySQL

    Codeigniter 3 - CRUD(Create, Read, Update and Delete) using JQuery Ajax, Bootstrap, Models and MySQL

    Open Post

    AngularJS - simple image upload with preview example in PHP

    AngularJS - simple image upload with preview example in PHP

    Open Post

    Ajax Image Upload Example with Validation in PHP Laravel Framework

    Ajax Image Upload Example with Validation in PHP Laravel Framework

    Open Post