Jun 26

Differences in joomla 1.5 and joomla 1.6

Joomla 1.6 shows quite a lot of prominent changes as compared to its previous version 1.5. And even with the advance of the 1.6th version of joomla, the joomla developers are still continuously working quickly to release joomla version 1.7, probably on 19 July 2011. Joomla version 1.7 alpha release is available for download and meant for only testing purpose.

Personally I found a few of the changes quite interesting and good while few of them annoying and maybe even unnecessary. Below I have mentioned some of its changes according to my experience and perspective.

I would surely like your feedbacks and views. And please don’t forget to add something regarding any points I have mentioned here or if you would like your’s as well.joomla 1.6

 

1] In joomla 1.6 codes are nearly less than 35% from that in joomla 1.5. The codes written in joomla 1.6 are more efficient and handle more features also commented in better way.

2] The PHP version supported in joomla 1.6 is greater than PHP 5.2 which make it more reliable and faster.

3] In joomla 1.5 to show module position by adding ?tp=1 at the end of the URL is on by default but in joomla 1.6 this feature is off by default. You can enable it by going to template manager >> Options>>Templates.

4] Section manager has been removed from back-end. Now there is only Category Manager which has much better flexibility. Now you can manage category inside another category up to 10 levels deep.  Off course this ended the need of Section manager which is present in joomla 1.5.

5] Joomla 1.5 has a section which deals with front page in FrontPage manager. This option in joomla 1.6 has come with the name of Featured articles.

6] In joomla 1.6 we have plenty of options to set user access levels. We can set access levels for each individual user as well as whole group.

7] The template assignment can be done through menu items also.

8] In Joomla 1.5 there is no language file for the templates but in joomla 1.6 templates support language files.

9] Templates style and layout override is supported in joomla 1.6 while it is not possible in its previous version.

 

There are many others changes and difference in joomla 1.6. I would like to hear from you if you can suggest.Any comments or suggestions are most welcome.

 

Jun 07

10 Most Popular FTP Clients

Well I just wanted to put out a small list of the best or the most used FTP Clients which I personally found worth mentioning. Don’t get me wrong… there are many more FTP Clients which I haven’t put up here …but since I had to choose from a pool of them… I came up with this short list of my personal BEST :) .

If you think there is some other Client worth adding to the list do let me know … I would appreciate the suggestion and the feedback.

Well I hope this list helps a few people in finding what they want when it comes to their file transfer needs or secure file transfers. Enjoy.

 

1. FileZilla – All platforms ( free )

 

2. SmartFTP – Windows ( free & paid )

 

3. FireFTP – All platforms with Firefox ( free )

 

4. WinSCP – Windows ( free )

 

5. Cyberduck – Mac & Windows ( free )

 

6. FlashFXP – Windows ( free & paid )

 

7. CuteFTP – Mac & Windows ( free & paid )

 

8. WS_FTP – Windows ( trial & paid )

 

9. GoFTP – All platforms ( free & paid )

 

10. CoffeeCup - Windows

Free FTP –  ( free )

Direct FTP( trial & paid )

May 10

Changes in HTML 5.0

HTML is the most powerful content presenting language of the WWW, an old but crucial technology of the Internet. HTML 5 is the latest version of HTML standard and it added a lot of new features compared to the previous HTML 4 for better experience on web page layouts and designs. With new HTML 5 get ready to experience a new web browsing in multimedia and graphics related content. Almost all major browsers have already started supporting most of its elements and attributes.

I have mentioned below a few new changes and additions of elements and attributes in HTML 5.

 

Doctype and Charest

In new HTML 5 you can write <! doctype html> instead of long doctype declaration in HTML 4, it’s because HTML 5 is now separated from SGML.

HTML 5 uses UTF-8 as character set which again can be defined in meta tag as <meta charset=”UTF-8″>

 

New structure defining Tags

With HTML 5 web pages can now be easily structured.

<section> This new tag defines a section in web pages. this can be considered as the any chapter of the book. Section may be footer, header any part of the document.
<nav> Defines navigation from current pages, easy to handle other links on pages.
<header> Not same as <head>, It defines the heading of documents or sections.
<footer> You can easily guess as the name suggest, it defines the footer of the document or sections and generally contains the copyright or author name like information.
<article> The main text content of the page, also the external text content from blogs and forums can be linked.
<aside> To define some extra content apart from the main. It may represent content related to the main content in form of note, tip, pull quote, sidebar or remark.
<figure> It can represent a block of images or video. This related to the document or the section.


Inline elements

<mark> This is for highlighted text. Think of a highlighted text of a book. It is just like emphasized text but not exactly the same.
<time> To define the content of the HTML as time or date. It defines a specific moments.
<meter> Used to show a part of a numeric value, you can say a fraction of a value.
<progress> To define the state of any outgoing process. It defines the progress of work.

 

Media elements in HTML 5

<video> Allow adding video on your web page directly and in very simple way.
<audio> Simply add audio stream on your web page.
<embed> To embed plug-in like content.

 

The exciting new <canvas> element

Now on your web pages you can directly add images or graphs in <canvas> tag using JavaScript.
It basically provides drawing space on your web pages using JavaScript

 

The New form elements in HTML 5

<datalist> Provide a list of option for input values.
<output> This defines the output obtained from some different script.
<keygen> To authenticate users directly from HTML code.

 

Input type attribute’s values in HTML 5

<input type=”tel”> The ‘tel’ value of type attribute is for telephone number.
<input type=”search”> This value defines input field as search field.
<input type=”url”> This attribute value tells input value is an URL.
<input type=”email”> The input value is an email.
<input type=”datetime”> This attribute value defines input value is date or time.
<input type=”date”> This value defines input value is a date.
<input type=”month”> Input value is a month.
<input type=”week”> Input value is a week.
<input type=”time”> Input value is a time.
<input type=”number”> Input value is of type number.
<input type=”range”> Input value is a number in a defined range.
<input type=”color”> Input value is color in hexadecimal notation
<input type=”datetime-local”> Input value is local date or time.

 

Some other new elements in HTML 5

<command> Defines a button, radio button or checkbox,used with <menu> tag
<details> Defines the details of a document or a part of the document. We can use < legend> tag to summarize it further inside it if needed.
<wbr> Word break.

Note: [ There are many other new HTML5 elements which are introduced but not mentioned here. ]

 

Now I would like to tell about some HTML elements which have been removed in HTML 5 recently

<center>
<acronym>
<noframes>
<applet>
<big>
<dir>
<basefont>
<font>
<frame>
<frameset>
<s>
<strike>
<u>
<tt>
<xmp>


Get ready for new web experience

In near future all the major browser like Firefox, IE, Chrome, Safari, Opera will support these tags and we will get more interactive web pages over Internet which will change our web experience forever. Though some of the tags might be removed due to not being able to fulfill   the actual purpose they were meant for, but these changes will give a new turn to the era of web page development and design. I would request the readers to write any of their feedbacks or comments on this topic.

Apr 25

Expected changes in PHP version 6

Right now the most stable version of PHP is v5.3.6 released on march 17, 2011. PHP is powerful web language which has a big community support. The most beautiful part of PHP is that it costs you nothing to download and you will get millions of tutorials and books to learn PHP. It first appeared in 1995 and since then it has gone through a long journey with many changes. Recently I found out that PHP is releasing its version 6 in the near future, as expected it will have many changes as compared to its previous version. The most expected changes are listed below.

Remember whatever you read here is only a prediction and not 100 % proven. We can only be sure when the actual end result , that is the final version 6 of PHP is released.

 

Register Globals most likely to be removed

This setting in file PHP.ini is a major security problem with PHP if turned on. This setting when turned ‘On’ tells to register the contents of the GET, POST, COOKIE, SERVER and Environment variables as global variables.

For example, http://www.xyz.com?name=joe will set $name as a global variable without any coding. That’s a really huge security risk and if removed in v6 will be highly praised.

 

Magic Quotes will also be removed

The three major function magic_quotes, magic_quotes_sybase and magic_quotes_gpc  are introduced for newbies to write SQL commands without the requirement of manual escaping. This was a mistake done by inexperienced developers  more frequently and caused a lot of security issues.

 

String Indexes  { } and [ ]

It is expected in version 6 the value of string’s character at a specified position cannot be referred by using { }. In PHP 5 it generated warning messages. The only usage will be the standard array position syntax,  [ ].

 

Unicode Support in PHP

Presently in PHP, Unicode is accessed on per request basis. It cannot be used globally  and hence it uses more resources.  It is expected that this issue would get fixed in the much awaited PHP version 6.

 

var same as public

In PHP v6 ‘var’ will be an alias of ‘public’ and will not show any warning.

 

Any return by reference will generate warning

For example function &xyz will generate warning.
Similarly $ab = & new Exclass() will generate a warning as well.

 

Other possible changes

- There will be no safe mode
- E_STRICT will be merged into E_ALL
- Ternary operator ‘?’ will work as below
$x = $_POST[‘name’] ?: ‘joe’ i.e if $x is true, $x will be equal to joe.

- Type hinted return value
- foreach multidimensional array

example-  foreach($a1 as $a2 => list($a3,$a4))

I hope PHP developing experience will certainly grow more interesting as soon as this version is out in the world.
Well I am one of those people who are eagerly waiting for the new release of PHP v6.

Apr 16

55 of the best Icon Downloads on Deviantart 2011

I have been putting up many such similar lists which suggested the Best and the Latest sets of icon collections and many other such website links for others to check them out, without having to browse all over the web.

Now since I really felt that Deviantart is one of the best sites to find icon collections and much more such artistic creations, I decided to dedicate a full blog post just to let you guys know which icon-sets I found to be the <b>best</b>.

And the cool thing about this list that every single icon collection mentioned here is <b>Free to download</b> directly from their pages :)

So I hope you enjoy going through 55 of the most innovative and beautiful icon designs on Deviantart.
Have fun !!!

1. Albook extended 811 icons

2. Drink Web 2.0 Icon Pack

3. PixeloPhilia 32PX Icon Set

4. IconTexto Web 2.0 Inside

5. Twitter Icons TweetMyWeb 7

6. web 2 icon set

7. Paper feed icons

8. hydroxygen iconset

9. OnceAgain

10. MinIcons

11. Oxygen

12. isabi

13. Helix icons

14. Aeon

15. ALL ICONS pack “limewire”

16. Basic set

17. Realistic Icons Preview icons

18. 3D Cartoon Icons Pack III

19. Developpers Icons

20. Icon Set

21. Lucid Icons

22. iConPack now with psd

23. HP Dock Icon Set

24. Puck Icons Pack II

25. Yeti Box 2

26. Grzanka’s Icons

27. D-Squared

28. Devine Icons

29. Black and Blue Icons

30. Orb Icons Pack

31. Massive Media Icons Win

32. Christmas Icons 2007

33. Social Icons hand drawn

34. Token

35. Boolean 1 1

36. Onibari light

37. Sketched-up free iconset

38. facebook ui icons vector

39. ” ecqlipse 2 “

40. Leopar’d IconPackager

41. TextEdit

42. icon for transformers

43. Adobe CS3 full pack

44. Apple Mail Icons

45. AccBox

46. Windows Icons V1

47. ICON EverGreen

48. Remixed AddressBook Icons

49. Drop-Box Icon

50. Mailbox Icon

51. Yoritsuki icons

52. Concave Icons

53. Software Icons Pack

54. MP3 Players Icons

55. NeonX Icons

Apr 10

Top 50 Best Free & Paid Icon Sites

Previously I posted a short list of links for selected icon-sets or icon collections which had only those icon-sets which were in the corners of some website, but this time I thought I would post a long list of websites that have a huge extent of high quality diverse collections of icons :)

Here is a list of the best sites I have found over the Internet which have a great collection sets of icons.

The list does include the Free and Paid websites, but most of them are free.
I hope you enjoy feasting your eyes over these lovely collection of creative imagination and hard work :)
Have Fun !!!

P.S – The list is in alphabetical order, so try not to miss out on the ones listed at the bottom just because they haven’t been added at the start of the list.

1. 365psd.com – free

 

2. alturabit.com – free

 

3. bestfreeicons.com – free

 

4. bijusubhash.com – free

 

5. csscreme.com – free

 

6. designmoo.com – free

 

7. doublejdesign.co.uk – free

 

8. dryicons.com – free

 

9. fasticon.com – free

 

10. flashripper.net – free

 

11. freeiconsweb.com – free & paid

 

12. gosquared.com – free

 

13. blog.guifx.com – free

 

14. icofree.com – free

 

15. icojoy.com – free & icojoy.com – paid

 

16. iconbee.willmayo.com – free

 

17. icondrawer.com – free & paid

 

18. iconeasy.com – free

 

19. iconeden.com – free & iconeden.com paid

 

20. iconfever.com – free

 

21. iconpot.com – free

 

22. iconstick.com – free

 

23. iconbulk.com – free

 

24. icondock.com/free – free & icondock.com/icons – paid

 

25. iconfactory.com – free

 

26. icongalore.com – free & paid

 

27. iconshock.com – free & paid

 

28. iconspedia.com – free

 

29. iconzworld.com – free

 

30. instantshift.com – free

 

31. jordan-michael.com – free

 

32. juicyicons.com – free

 

33. icons.mysitemyway.com – free

 

34. photoshop.backata.com – free

 

35. psd.tutsplus.com – free

 

36. smashingmagazine.com – free

 

37. stockicons.com paid

 

38. studiotwentyeight.com – free

 

39. turbomilk.com – free

 

40. tutorial9.net – free

 

41. vecteezy.com – free

 

42. vistaicons.com – free

 

43. visualpharm.com – free

 

44. weloveicons.com – free

 

45. webiconset.com – free & paid

 

46. webappers.com – free

 

47. websiteicons.com – free & paid

 

48. websiteicons.net – free

 

49. wefunction.com – free

 

50. zeusboxstudio.com – free

And one more cute one which I don’t want to leave out is this is :)

famfamfam.com – free

Mar 27

A very efficient way of instantiating a class dynamically in PHP


Since PHP is a loosely typed language, it provides great flexibility in creating variables and objects at runtime without having to specifically declare them first. It is well known that $i=10, $i=”test”, $i = date() will all work without creating any syntax or compile errors.

A lesser used concept is that this feature can be used to create an object at runtime without having to check for the object type at first. Eg.if you have had 3 classes and only one of them had to be created depending on a condition the following would be the sample code:

<?php
	error_reporting(E_ALL);

	class Generic {
		function xprint() {
			echo("generic");
		}
	}
	class A extends Generic{
		function xprint() {
			echo("A");
		}
	}

	class B extends Generic{
		function xprint() {
			echo ("B");
		}
	}

	class C extends Generic{
		function xprint() {
			echo("C");
		}
	}

	$test = "B";
	if ($test =="B")
		$x = new B();
	else if ($test == "A"
		$x = new A();
    else if ($test == "C")
	    $x = new C();
	$x->xprint();
	echo("end");
?>

Instead of doing multiple checks and then creating the relevant class, a more efficient way is to pass the classname as a string and then create it directly as shown below:

<?php
	error_reporting(E_ALL);

	class Generic {
		function xprint() {
			echo("generic");
		}
	}
	class A extends Generic{
		function xprint() {
			echo("A");
		}
	}

	class B extends Generic{
		function xprint() {
			echo ("B");
		}
	}

	class C extends Generic{
		function xprint() {
			echo("C");
		}
	}

	$test = "B";
	$x = new $test();
	$x->xprint();
	echo("end");
?>

The above code will print “B” since it creates the class B in $x. What about classes where arguments are required in the constructor? Simple call it with the arguments eg. $x = new $test(“arg1″, “arg2″);

Mar 27

List of Web-Browsers with download links & official websites


Well these are a few of the names and their respective links of certain web-browsers over the Internet which you can find and use according to your needs.
Most of the main ones you already know like Internet Explorer, Mozilla Firefox, Google Chrome, Opera, Safari and more.

Below we have a tabular format of information comprising of the browser’s name, developer/company links, download page links, current version available and what types of operating systems do each of them support.

Internet Explorer

Internet Explorer

- Windows

Mozilla Firefox

- click here to download version 4.0
- Windows, Mac OS, Linux, Maemo, Android, Nokia N900

Google Chrome

- click here to download version 10.0.648.151
- Windows, Mac OS, Linux

Opera

- click here to download version 11.01
- Windows, Mac OS, Linux, Android, iPhone, Tablets

Safari

- Windows, Mac OS

Netscape Navigator

- click here to download version 9.0.0.6
- Windows, Mac OS, Linux

Camino

- click here to download version 2.0.7
- Mac OS

Sea Monkey

- click here to download version 2.0.13
- Windows, Mac OS, Linux

K-meleon

- click here to download version 1.5.4
- Windows

Galeon

- click here to download version 2.0.2
- Linux

Konqueror

- click here to download version 4.6
- Mac OS, Linux

Maxthon browser

- click here to download version 3.21.1000
- Windows, Android

Flock browser

- click here to download version 2.6.1
- Windows, Mac OS, Linux

Lunascape

- click here to download version 6.4.4
- Windows

Amaya

- W3C
- click here to download version 11.3.1
- Windows, Mac OS, Linux

iCab

- click here to download version 4.8a
- Mac OS, iPhone, iPod Touch, iPad

Midori

- click here to download version 0.3.3
- Windows, Mac OS, Linux

Uzbl

- Uzbl
- Linux

RockMelt

- click here to download version 0.3.3
- Windows, Mac OS

Voyager

- click here to download version 3.3.125
- Others

Dillo Web Browser

- click here to download version 2.2
- Windows, Mac OS, Linux, *BSD, Solaris

Slim Browser

- click here to download version 5.01.023
- Windows

KidRocket

- KidRocket ( official site not available )
- click here to download version 1.5.0.2
- Windows

Epic Browser

- click here to download version 1.2
- Windows

Iron Browser

- click here to download version 10.0.650.0
- Windows

GNU IceCat

- click here to download version 3.6.9
- Mac OS, Linux

Comodo Dragon

- click here to download version 4.1.1.12
- Windows

OmniWeb

- click here to download version 5.10.3
- Mac OS

Crazy Browser

- click here to download version 3.05
- Windows

ShenzBrowser

- click here to download version 1.1
- Windows

Swiftweasel

- click here to download version 3.5.5
- Linux

Enigma Browser

- Windows

Kazehakase

- click here to download version 0.5.8
- Linux

Shiira

- Shiira Project ( official site not available )
- click here to download version 2.3
- Mac os

Avant Browser

- Windows

xB Browser

- click here to download version 3.9.10.24
- Windows

Sleipnir

- click here to download version 2.9.6
- Windows

Space time

- click here to download version 1.0
- Windows

Browse3D

- click here to download version 3.5
- Windows

3B Rooms

- 3B
- click here to download version 3.11
- Windows

Bitty Browser

- Windows

Lobo java Web Browser

- click here to download version 0.98.4
- Linux

Elinks text www Browser

- click here to download version 0.12
- Linux

Epiphany

- click here to download version 2.30.6
- Mac OS, Linux

Grail

- CNRI
- click here to download version 0.6
- Windows, Mac OS, Linux

Ibrowse

- click here to download version 2.4
- Other
Lynx
- click here to download version 2.8.7
- Windows, Mac OS, Linux

Iceweasel

- click here to download version 1.5.0.8
- Linux

Mozilla Minefield

- click here to download version 4.2
- Windows, Linux

NetSurf

- click here to download version 2.6
- RISC os, Linux, Unix, Haiku & BeOS, AmigaOS
Conkeror
- Windows, Unix/Linux, Debian & derivatives

Deepnet Explorer

- click here to download version 1.5.3
- Windows

PhaseOut

- click here to download version 5.4
- Windows

Wyzo

- click here to download version 3.6.4 (Windows) 3.5.6 (Mac)
- Windows, Mac OS

Zac Browser

- click here to download version 1.5
- Windows, Mac OS

Oregano

- RISC OS

Acoo Browser

- click here to download version 1.98.744
- Windows

Cayman Browser

- click here to download version 2.2
- Windows

GoSurf

- click here to download version 2.84.903.8452
- Windows

GreenBrowser

- click here to download version 5.8.0315
- Windows
Dec 18

Running multiple Firefoxes on one machine in Windows


Recently I was working on the designs of a few websites and I had come across an unusual new problem for me. I do know that different versions of Internet Explorers have different way of rendering the same HTML page and therefore look a lot different in different versions of IE.But now I also realized that in certain situations even different versions of Firefox also have this problem ( quite rare as compared to IE ) so now I had the need to install 2 different of Firefoxes on my machine to check the layout of a particular webpage design I was working on.Mozilla Firefox

So these are the simple steps to install as many Firefox as you want and run multiple instances of Firefox at the same time with different settings, add-ons etc. on a single machine (with Microsoft Windows operating system, in this case Windows XP SP2 )

Now let us start with the first Firefox installation – in this case I take Firefox version 3.5.5

When you start the installation, the folder which is the default folder is something like this

c:/program files/Mozilla Firefox” so do one thing, just create a separate folder for the particular version of Firefox you are installing, like for example

“c:/program files/Mozilla Firefox/ Firefox3x5″ and then continue your with the installation.

In the same way… now you have to install the next version of Firefox which may be any older version which in this case I choose as Firefox 3.0.8

so with the same procedure as above, I just change the installation folder to

“c:/program files/mozilla Firefox/Firefox3x0″ and complete the installation as you normally would.

Now that we have 2 different versions of Firefox installed on the same machine, we have to customize it in a way that both can run simultaneously without any problems.

For that we have to create separate individual user profiles so that we can handle the execution of 2 different Firefox versions.

To create the profiles in Firefox… go to command prompt or cmd , in the command prompt if the directory paht is not c: then change the directory path to c: by just typing c: in the comman prompt, which will change it from any other drive to c:  like this

 

changing the command prompt to c:

changing the command prompt to c:

and then after your in the c:>  write exactly like this

“c:PATH TO YOUR FIREFOX (ANY VERSION)Firefox.exe” –profilemanager

Now in my case , I had to write this in the command prompt

“C:Program FilesMozilla FirefoxFirefox3x5firefox.exe” –profilemanager

 

opening Firefox profile manager through command prompt

opening Firefox profile manager through command prompt

which will open a popup window something like this

 

Firefox profile manager popup screen

Firefox profile manager popup screen

Create at least 2 profiles for the 2 different versions you have on your machine. You can create as many profiles as you want according to the number of different versions which you want to run.

For example in my case I created one as “default” (which already exists but if you want to change it, you can name your profile anything u want) and the other as “arunace” now that you have created the profiles just click close or exit.

As there are 2 different versions so I will make respective shortcuts for each of them on my windows desktop, for example

For Firefox 3.5.5, I create a desktop shortcut and rename it as Firefox3.5

and for the other version of Firefox 3.0.8, I create a desktop shortcut and rename it as Firefox3.0

Now there is something you need to change in the properties of the shortcuts created, that is … go to the first shortcut like take Firefox3.5 for instance, do a mouse right click and go to its properties, change the target link to

“C:Program FilesMozilla FirefoxFirefox3x5Firefox.exe” -p default

-p means parameter which is passed with the target to specify which user is related to that particular shortcut and loads that user profile when you use that shortcut

the same goes for the next shorcut that is Firefox3.0 , got to its properties , change the target link to

“C:Program FilesMozilla FirefoxFirefox3x0Firefox.exe” -p arunace

which specifies that when I use the shortcut for Firefox3.0 , the user profile named “arunace” will be used .

Now one more thing which you have to fix is that … just add another parameter to one of the many shortcuts created in the target link to make it possible for the machine to run multiple instances of Firefox at the same time with different users and their settings , that is

“C:Program FilesMozilla FirefoxFirefox3x5Firefox.exe” -p default -no-remote

and now you can use 2 different versions of Firefox by just clicking the different shortcuts for the different versions you want to use on the same machine and at the same time.

Do let me know if there is any problem with these steps or if I can improve anything in this blog.

Good Luck !!!

Nov 22

Handling special symbols in csv file in PHP


PHP provides the fgetcsv function to automatically import values from a csv file. However it does not consistently work with cases where the starting of a field value has an extended character like the pound sign or a foreign character. In such cases, fgetcsv simply omits that first character and gets the remaining data of the column.

Eg.”Buyagift.co.uk”,”273″,”xmas1075″,”£10 off when you spend over £75 on all products excluding our amazing special offers”

will be imported as

“Buyagift.co.uk”,”273″,”xmas1075″,”10 off when you spend over £75 on all products excluding our amazing special offers”

One officially recommended way of handling this is to set the locale before running fgetcsv . But somehow this does not always work. After trying various approaches we have come up with our own solution which works in all cases.

We do our own preprocessing of the csv file before passing it to fgetcsv(). Our approach is to detect any character following a comma which is beyond the ascii printable range of codes from 32 to 126. If it detects any such character it precedes it with a slash. The complete  data thus updated is written back to the file and then passed to fgetcsv().

So “Buyagift.co.uk”,”273″,”xmas1075″,”£10 off when you spend over £75 on all products excluding our amazing special offers”

will become “Buyagift.co.uk”,”273″,”xmas1075″,”£10 off when you spend over £75 on all products excluding our amazing special offers”

At a later stage the once the data array has been obtained from fgetcsv, we remove the preceding slash by running stripcslashes() to the value.

The code fragment is given below:

$f = fopen(“myfile.csv”, “r”);
if ($f) {
$data = fread($f, filesize(“myfile.csv”));
fclose($f);
$arr = explode(“n”, $data);
$newData = “”;
for($i = 0; $i < count($arr); $i++) {
$item = $arr[$i];
if (strlen($item) > 2) {
$x = explode(“,”,$item);
for($j = 0; $j < count($x); $j++)
{
if (ord($x[$j]) > 126)
{
$x[$j] = “\”.$x[$j];
}
}
$arr[$i] = implode(“,”,$x);
$item = $arr[$i];
$newData .= $item . “rn”;
}

}
}

// rewrite processed data back to file
$f = fopen(“myfile.csv”, “w”);
if ($f) {
fwrite($f, $newData);
fclose($f);
}
else
echo(“Unable to create file:”);

Handling The Euro Symbol

The above approach does not work for the Euro symbol since it does not get correctly interpreted even if a file is open in utf-8 mode. For this, the solution to open the file and simply replace the euro symbol with its html entity equiv: & html ; (remove the spaces in between).

Eg. $data = str_replace(“€”,”&euro;”,$data);