If your code is including other files, you will encounter problems like “The file is not found”. This is because, PHP doesn’t know the absolute path of file. So, if you are including files on another file, you should mention the absolute path of file. But, If you’re PHP application is being used by other people, then the absolute path which you mentioned in your system won’t be the one of the others’ systems.... [READ MORE]
Posts marked with "Posts" in posts
Check If A String Is JSON in PHP
In my previous post, I gave the isHTML function that returns if a string is HTML or not. In this post, I will give you a simple function of different ways that helps in the detection of valid JSON string in PHP. The function I’m giving are fast, easy and doesn’t take up too much CPU memory. Demo Method 1 JSON (JavaScript Object Notation) can be made in to a PHP object using json_decode.... [READ MORE]
Check If A String Is HTML In PHP
HTML detection can be hard, because HTML is complicated and there aren’t any good 100% parsers for HTML. RegEx won’t help you in detection, so you need something else. The trick to identify HTML which I’m gonna show you is very easy. It’s fast, short and doesn’t use RegEx. You can simply use an if statement to check if a string is HTML or not. Demo PHP’s strip_tags function when given a string, it returns a string that doesn’t have any HTML / PHP characters (according to the manual).... [READ MORE]
Disable Cache For Web Development In Chrome
If you’re developing a web page in Chrome and some changes you applied to code doesn’t take effect on the page, you will be angry. You will look and look into the code for errors. But it’s not the problem with your code. It’s the problem with the browser. The resources loaded on the page are cached. Hence the changes made to the code won’t be applied. So, you need some way to disable the cache.... [READ MORE]
9th Grade Is Over :-(
Today marks the end of 9th grade in my school life. It’s been a wonderful journey with a lot of laughs and seriousness. Got nice grades in the exams and all ends well & happy. Today, my classmates went wild. We celebrated and celebrated until the window was broken. The student who didn’t break the window with consciousness got beat up by the principal. It was painful to watch and hear his screaming.... [READ MORE]
Disable jQuery Migrate Loading In WordPress Blog
If you run a WordPress blog with all the new stuff (functions) and still WordPress loads the jQuery Migrate on your blog, you will be angry (I know hot it feels). The jQuery Migrate file’s minified version is about 7 KB and the unminified version is about 17 KB. That’s a file you don’t need if your blog’s jQuery functions aren’t deprecated. What’s jQuery Migrate ? jQuery Migrate is a JavaScript file that adds the jQuery deprecated functions to the page which makes us to use the deprecated functions of jQuery.... [READ MORE]
Posting Code Blocks On WordPress
If you’re a web developer or a programmer and have a programming blog set up in WordPress, you will find it difficult to include codes in the posts. There is no tool in the Visual Editor toolbar menu to automatically wrap a piece of code into a code block. So you have to manually go to the Text version of the post and add the code in HTML <pre> or <code> tag or inside <pre><code></code></pre>.... [READ MORE]
WhatsApp Acquired By Facebook For $19 Billion
The giant mobile messaging service WhatsApp has been acquired by social network giant Facebook for 19 billion US dollars. This is the biggest acquisition by Facebook in their 10 years. Facebook is making it’s way to enter the mobile communication world. The acquisition will make the WhatsApp CEO a billionare. This acquisition will make benefit to both WhatsApp and Facebook. Both companies’ CEO has been in discussions for 2 years. And the time has come for WhatsApp to sell to Facebook.... [READ MORE]
Configure WordPress To Not Use FTP To Do Stuff
By default, if you want to install plugins or upgrade WordPress, you have to provide the FTP details. If you are running WordPress on localhost, you won’t have the FTP credentials. In this case you won’t be able to install plugins or upgrade WordPress. There is a way to configure WP to don’t use FTP, instead install directly using the Read/Write permission of folder. If WordPress can’t install anything without FTP, it needs another method – direct install.... [READ MORE]
Make A Blank Template / HTML Page In Blogger
Blogger Templates can be very messed up with lots and lots of code. If you are trying to create a Blogger Template from scratch, the first thing you need is a blank HTML page. That’s exactly what we are going to do today. Demo Blogger Simple Template To Blank Page Criterias Blogger won’t allow you to just add the following code as template : <html> <head> <title>My Awesome Blank Blog</title> </head> <body> </body> </html> They will print out errors if you try to save the template.... [READ MORE]