A small jQuery Plugin i wrote to slug input fields, enjoy; (function( $ ){ function stringToSlug(str){ str = str.replace(/^\s+|\s+$/g, ''); // trim str = str.toLowerCase(); // remove accents, swap ñ for n, etc var from = "àáäâèéëêìíïîòóöôùúüûñç·_,:;"; var to = "aaaaeeeeiiiioooouuuunc—–"; for (var i=0, l=from.length ; i<l ; i++) { str = str.replace(new RegExp(from.charAt(i), 'g'), …Continue Reading
I had to do that recently and since i didn’t found anything PHP native to do it i had to code it myself, just 2 SMall Functions to Convert an stdClass Object in to an XML (Writer) Object, or an XML String at the End.
This Helper I use to store and resize Images (external or not) – it uses GD so make sure to have it, of course this is just an example, so you must change the structure of paths/URLs to your needs.
If you wanna make sure your text gets parsed correctly you mostly use htmlentities. However this method has 2 downsides: 1. It does not convert in to numeric entities so you’ll have problems when parsing as XML 2. It does NOT cover all characters that are like to show up.