PHP

How do you enter line breaks with raw_input? But, once you have a string with some characters in it you want to get rid of, just replace them.

str = raw_input('please enter string: ');
$demo = 'hello world, how do i enter line breaks?'
str.replace(' ', '',$demo);
 
output = 'helloworld,howdoienterlinebreaks?'
 

You need to listen to navigation event and state.direction.

 
$(window).on("navigate", function (event, data) {
  var direction = data.state.direction;
  if (direction == 'back') {
    // do something
  }
  if (direction == 'forward') {
    // do something else
  }
}); 
 
Demo 

http://fiddle.jshell.net/Palestinian/UKJRM/


 In this You have to create favicon icon. 

http://favicon-generator.org/

 ===========================================

What is a Cookie?

A cookie is often used to identify a user. A cookie is a small file that the server embeds on the user's computer. Each time the same computer requests a page with a browser, it will send the cookie too. With PHP, you can both create and retrieve cookie values.

-----------------------------------------------------------------------------------------
<?php
$cookie_name = "user";
$cookie_value = "John Doe";
setcookie($cookie_name, $cookie_value, time() + (86400 * 30), "/"); // 86400 = 1 day
?>
<html>
<body>

<?php
if(!isset($_COOKIE[$cookie_name])) {
    echo "Cookie named '" . $cookie_name . "' is not set!";
} else {
    echo "Cookie '" . $cookie_name . "' is set!<br>";
    echo "Value is: " . $_COOKIE[$cookie_name];
}
?>

</body>
</html>

No comments :

Post a Comment