Posts by jonathancardoso • 1,653 points
5 posts
-
0
votes2
answers3112
viewsA: Is there a URL in Nodejs?
If libcurl-only functionality is required, there is a package that serves as binding for libcurl on Node.js called node-libcurl. (I am the author of the same) Example of use: const { Curl } =…
node.jsanswered jonathancardoso 1,653 -
51
votes6
answers59467
viewsQ: How to calculate the difference between two dates?
What is the most practical way to find the time difference between two dates in the default format used by Mysql (YYYY-MM-DD)? Ex: Date 1: 2013-12-11 Date 2: 1994-04-17…
-
64
votes6
answers59467
viewsA: How to calculate the difference between two dates?
One of the ways to do this object-oriented, is by using the class Datetime, it has the method diff that returns an object Dateinterval, representing the interval between two separate dates:…
-
14
votes3
answers2493
viewsQ: How to check if a string has only uppercase letters?
How can I check whether all the characters in a string are capital letters? Preferably without the use of regular expressions.
-
23
votes3
answers2493
viewsA: How to check if a string has only uppercase letters?
For this you can use the function ctype_upper. $string1 = 'ALLCAPS'; $string2 = 'NotAlLCAPS'; var_dump( ctype_upper( $string1 ), ctype_upper( $string2 ) ); //bool(true) //bool(false) If it is…