PHP define php function and call it - Net-Raft.com

Welcome aboard! We are happy you are here and wish you good net-raft!




Just a Web Code Solution

How to define the php function and call it ?


 193

Show ResultPHP


1

<!DOCTYPE html>
<html lang="en">
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<meta charset="utf-8" />
<title></title>
</head>
<body>

<p></p>

<?php

define('GREETING', '<script type="text/javascript">$(document).ready(function(){$("p").text("Hello world!");});</script>');

function myTest() {

echo GREETING;

}

myTest();

?>

</body>
</html>


By        
The power of the user (%)
15%



The most helpful PHP solutions

detect browser phpdetect browser phpPHP

Click to see more ...

  4.4K     408

create QR code phpcreate QR code phpPHP

Click to see more ...

  2.9K     289

create relative date phpcreate relative date phpPHP

Click to see more ...

  2K     254

drag and drop upload file using phpdrag and drop upload file using phpPHP

Click to see more ...

  2.4K     253

delete array item phpdelete array item phpPHP

Click to see more ...

  2.3K     245

detect ie phpdetect ie phpPHP

Click to see more ...

  1.5K     213

detect speed internet phpdetect speed internet phpPHP

Click to see more ...

  1.4K     198

get current url phpget current url phpPHP

Click to see more ...

  1.5K     196

get meta tag phpget meta tag phpPHP

Click to see more ...

  1.3K     193

Get real client country using php ?Get real client country using php ?PHP

Click to see more ...

  1.2K     178