MySQL: Remove carriage returns and line feeds from table column

MySql

Well I just got into this weird issue when search query didn’t return what I was looking for even though it was there and I realized that the string contains carriage returns and line feeds in that column!! so to remove these characters simply run these queries and it should work fine.. 1 2 3 [...]

PHP Random Password Generator

php

Php random password generator with custom string length and strength.. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 function generatePassword($length=9, $strength=0) { $vowels = ‘aeuy’; [...]

Removing new line \n from string..

javascript php

Sometimes the invisible new line character breaks the code, specially when we are using some javascript. I had a recent experience when using wz_tooltip extension to create good tooltips and I realized that the newline character [\n] breaks the tooltip widget. You can easily remove these and replace them with <br> by following code.. 1 [...]