Monthly Archives: November 2013
How to strip all spaces out of a string in php
How to strip all spaces out of a string in php You have a string stored in a PHP variable, and you want to eliminate all whitespaces or spaces from that string with PHP, not only from the beginning or the end of the string. Scenario
1 2 3 4 5 6 |
<?php //You want to strip all spaces from the below string and obtain "thisisjustastring" $firstString= 'this is just a string'; ?> |
Solution for spaces
1 2 3 4 5 6 7 |
<?php $firstString= 'this is just a string'; $newString = str_replace(' ', '', $firstString); echo $newString; //outputs "thisisjustastring" as a string ?> |
Solution for whitespaces
1 2 3 4 5 6 7 |
<?php $firstString= 'this is just a string'; $newString = preg_replace('/\s+/', '', $firstString); echo $newString //outputs "thisisjustastring" as a string ?> |
Which IP address is using more bandwidth?
Which IP address is using more bandwidth? I’ve made before another article similar to this one about tracking and monitoring your server bandwidth, this however, is something a bit different, with more in depth view per IP address. Before you could see only the total amount of bandwidth used IN or OUT of your server, however
How to install SHOUTcast Server
How to install SHOUTcast Server I recently got a client seeking to install shoutcast server on his VPS server, normally we don’t install services other the default ones preinstalledinstalled/needed for any web server. However the specific client was looking for hosting his own shoutcast server for his little radio station and it seems that he
jQuery ajax tutorial example
jQuery ajax tutorial example This is probably the most interesting and yet complicated thing from our tutorial series. This is the magic that modern websites are using in order to update in real time their content, database, etc. What is AJAX ? Ajax stands for Asynchronous JavaScript and XML. From Wikipedia, it is a group of interrelated web development techniques used on
How to install Red5 Media Server on Ubuntu / Debian
How to install Red5 Media Server on Ubuntu or Debian Red5 Media Server is a powerful video streaming solution standing its own ground to the big giant Adobe with their own Adobe Media Server, however compared to them, Red5 is free, based on Java and other open source frameworks. It provides a good solution to
jQuery events handling
jQuery events handling Here we are with our next tutorial about events handling in jQuery. We arrived pretty far. By now you should know how to select elements from the DOM, use them further from traversing and all kinds of manipulations. What are events? Events are actions that can be detected by your Web Application