Archive

Posts Tagged ‘Functions’

Check if a string exists javascript

<script type=”text/javascript”>
if(window.location.href.indexOf(“https:”) > -1) {
alert(“its a secure URL”);
}
</script>

EmailFacebookLinkedInMySpaceDiggTumblrStumbleUponShare

Replace a string javascript

<script type=”text/javascript”>
var string=”PHPCode”;
string=string.replace(“Code”,”Codez”);
alert(string);
</script>

EmailFacebookLinkedInMySpaceDiggTumblrStumbleUponShare

CURTIME() Vs NOW()

CURTIME() returns the TIME part of the current time.
NOW() returns the date and time portions as a timestamp in various formats, depending on how it was requested

Example

mysql> SELECT NOW(),CURDATE(),CURTIME();
+———————+————+———–+
| NOW() | CURDATE() | CURTIME() |
+———————+————+———–+
| 2012-06-18 14:14:01 | 2012-06-18 | 14:14:01 |
+———————+————+———–+
1 row in set (0.03 sec)

EmailFacebookLinkedInMySpaceDiggTumblrStumbleUponShare
Categories: My SQL Tags: , , ,

The difference between MySQL CURTIME() and NOW()

CURTIME() returns the TIME part of the current time.
NOW() returns the date and time portions as a timestamp in various formats, depending on how it was requested

Example

mysql> SELECT NOW(),CURDATE(),CURTIME();
+———————+————+———–+
| NOW() | CURDATE() | CURTIME() |
+———————+————+———–+
| 2012-06-18 14:14:01 | 2012-06-18 | 14:14:01 |
+———————+————+———–+
1 row in set (0.03 sec)

EmailFacebookLinkedInMySpaceDiggTumblrStumbleUponShare
Categories: My SQL Tags: , , ,

MySQL CURDATE() Vs NOW()

CURDATE() returns the DATE part of the current time.
NOW() returns the date and time portions as a timestamp in various formats, depending on how it was requested

Example

mysql> SELECT NOW(),CURDATE(),CURTIME();
+———————+————+———–+
| NOW() | CURDATE() | CURTIME() |
+———————+————+———–+
| 2012-06-18 14:14:01 | 2012-06-18 | 14:14:01 |
+———————+————+———–+
1 row in set (0.03 sec)

EmailFacebookLinkedInMySpaceDiggTumblrStumbleUponShare
Categories: My SQL Tags: , , ,

The difference between MySQL CURDATE() and NOW()

CURDATE() returns the DATE part of the current time.
NOW() returns the date and time portions as a timestamp in various formats, depending on how it was requested

Example

mysql> SELECT NOW(),CURDATE(),CURTIME();
+———————+————+———–+
| NOW() | CURDATE() | CURTIME() |
+———————+————+———–+
| 2012-06-18 14:14:01 | 2012-06-18 | 14:14:01 |
+———————+————+———–+
1 row in set (0.03 sec)

EmailFacebookLinkedInMySpaceDiggTumblrStumbleUponShare
Categories: My SQL Tags: , , , ,

Language Constructs

Language constructs are used and behave almost similar to built-in functions .
The real difference lies in how PHP engine interprets a language construct and a built-in function. language constructs are relatively faster over built-in functions since they are bound to the language.Language Constructs Don’t Need Parenthesis .Language constructs are faster than built in functions

Below given are the examples

echo
die
if
print
unset
isset
empty
include
require


EmailFacebookLinkedInMySpaceDiggTumblrStumbleUponShare
Categories: PHP Tags: , ,

Can echo in php accept more than 1 parameter?

Yes echo() can accept more than one arguments .

EmailFacebookLinkedInMySpaceDiggTumblrStumbleUponShare
Categories: PHP Tags: ,

Switch to our mobile site