The problem is quite simple…you just want to count a specific tag in a page and insert some content. After or before it’s just a matter of perspective. So let’s say you want an ad, for example, to be inserted, after the fourth H2 tag.
||logical operators seem to have more general recognition and background usage, although the
or form of the same logical operators is taking more and more acceptation for the sake of readability.
So here is a list for the results when evaluating the expressions in PHP. I am sure that this can be applied to a bunch of other languages. (I think it is a little bit superficial to say that it apply to all programming language since I only know some of them). Continue reading “PHP logical operators true false”
I was dealing with this problem for a while and did not know how to give WordPress permission to write to his folders when updating plugins or themes.
On the other hand this was forcing me to chmod
wp-content/uploads folder with 777 permissions. I am not a heavy image uploader, so when I was in need of updating I was just chmod to 777 and then, after uploading my stuff, get back to 755.
Well..it’s true. The PHP
glob() function is a big dinosaur, memory eater and speed blow upper (if that can be said). So let’s test the
glob() function against some other alternatives.
I have recently had to detect duplicated/missing files comparing two directories in a set of 80.000 files and I used the PHP
glob() function. 80k is a reasonable number for a local machine. But later I had to deal with 800k and that is really a lot if you don’t do things the right way. So I had to try some other alternatives.
I had to do some benchmarking in the area and I used a set of 25.000 images and another folder with 10.000 random duplicates. I think this is a reasonable number to see any differences in the final result.
Detecting the missing files when comparing two directories can be a tricky job to do. So this is my scenario:
I am trying to pass some image throw a small piece of software for batch processing and I always get timeout due to the big quantity of images. There are around 80.000 images that I am trying to process and the software get stuck to (let say) 10.000 images so I have to start all over again and I have no idea which are the missing files.
So my solution is to take out the images that have been processed from the folder and feed the program with the images that have not been processed.
So to find out this I have to compare the 2 directories for duplicated files. In other words “detect the missing files”
If you are like me playing around with the WordPress Multisite feature and you’ve run into the max allowed upload filesize limit of 1M, you are in the right place to fix it.
There is a not quite intuitive (for me) option in the Super admin dashboard that allows you to change this. Please note that this does not overwrite your apache or php.ini settings if this last one is smaller. Here you can apply the rule of the most restrictive.
So you want to migrate a WordPress database and you came into the problem that when you load the new installation directory you are being redirected to the old domain. You probably tried to manually replace in your PhpMyAdmin in the
wp_options table the two entries that normally exist, but still no success. Maybe your website is loading but there are lots of errors in there.
This is because WordPress and lots of plugins store data and full URI in the database using wp_serialize function. Here is a little example about what I am talking about: