View fiddle_076616.php
<html>
<body bgcolor="#0969 text=pink">
<?php
function familyName($fname)
{
echo "$fname Rao.<br>";
}
familyName("Jhansi");
View fiddle_039385.php
<!DOCTYPE html>
<html>
<head>
<title>RPS</title>
</head>
<body>
<h1>RPS</h1>
<?php
$numberPicked = rand(1, 3);
View fiddle_025967.php
<!DOCTYPE html>
<html>
<head>
<title>RPS</title>
</head>
<body>
<h1>RPS</h1>
<?php
$numberPicked = rand(1, 3);
View fiddle_059689.php
<?php
/*
Author: Nishant Nair
Date: 25-Dec-2016
Input: Array of data consiting od mutual fund details.
Output: Best mutual fund depending upon the oondition.
Program to find out the best mutual fund with below criteria.
1. Fund launch date before 2009
View fiddle_096353.php
<?php
include('php/userloginprocess.php'); // Includes Login Script
include('php/addtocartprocess.php');
$prod_id = $_SESSION['cart'];
/*$id = $_SESSION['prod_id'];
$gadgets = $_SESSION['prod_id'];*/
if($_SESSION['login'] == FALSE){
header("location: login.php");
}
if($_SESSION['login'] == TRUE)
View fiddle_064382.php
<?php
include('php/userloginprocess.php'); // Includes Login Script
if($_SESSION['login'] == FALSE){
header("location: login.php");
}
if($_SESSION['login'] == TRUE)
?>
<!Document HTML>
<html>
View fiddle_037983.php
<?php
if (session_status() == PHP_SESSION_NONE) {
//there is a session start code here but the website disabled it
$_SESSION['cart'] = array();
}
$connection = mysql_connect("localhost", "root", "");
if(isset($_GET['add_to_cart'])){
array_push($_SESSION['cart'], $_GET['product_id']);
header("location: ../android.php?id=" . $_GET['product_id'] . "");
}
View fiddle_051219.php
<?php
$question_data = '<p>My questions here....</p><p>&nbsp;</p><p><img class="img-responsive" src="/uploads/images/questions/93_20161017102613.jpg" style="max-height:400px;" /></p>';
$xml = new DOMDocument();
$xml->loadHTML($question_data);
//Initial Dom
//Find only image and convert url
View fiddle_059680.php
<?php
// This line prints Hello
echo "<h1>Hello, World from PHP!</h1><br>";
// This line prints the filename of the currently executing script (relative to the document root)
echo "Script = ".$_SERVER['PHP_SELF'];
?>
View fiddle_097219.php
<pre>
<?php
$json = '{"a": {"b":"5"}}';
$valueDecodeObject = json_decode($json);
$valueDecodeArray = json_decode($json, true);
echo "<p>Option 1: </p>";