Blog Archives

PHP Tutorial : Write to a file with fwrite

I showed you earlier in a older post how to open and read text contents from a file. Now it’s time to see how to write to a file using php function called fwrite().

Note that “\n” means new

Click on title to read the entire article

Tagged with: , , , ,
Posted in Basic PHP

PHP Tutorial : Multiple string replace with str_replace

Well, I already writed about str_replace php function but this tip is very usefull. To recap, the function it’s used to replace a string by using three paramaters : $stringToSearch, $stringToReplace, $intoString. I showed you how to use it in

Click on title to read the entire article

Tagged with: , , , , , ,
Posted in Basic PHP

PHP Tutorial : Strpos and Strrpos

Basic thing, strpos and strrpos are two php functions which are used to find the position of first and/or last occurrence in a string – word (usefull for example when you want to build a function to get file extension).

Click on title to read the entire article

Tagged with: , , , ,
Posted in Basic PHP

PHP Tutorial : String lenght with strlen

I’ll be directly on this short one. Shame on me that I didn’t writed about this untill now : there’s an interesting php function which you might need frequently called strlen() which translates into string lenght. I’m sure you met

Click on title to read the entire article

Tagged with: , , , , ,
Posted in Basic PHP

PHP Tutorial : If condition in the short way (shorthand if)

Do you know basical php if() condition right? But, my questions is : do you know the short way? If not, I will show you the diferrence,:

Tagged with: , , , , ,
Posted in Basic PHP