<script type="text/javascript">
var abc= 'this is text';
<?php $abc = "<script>document.write(abc)</script>"?>
</script>
<?php echo $abc;?>
<script type="text/javascript">
var php_var = "<?php echo $php_var; ?>";
</script>
<script>
var p1 = "success";
</script>
<?php
echo "<script>document.writeln(p1);</script>";
?>
$idget=$_GET['id'];
var id = <?php echo json_encode($idget); ?>;
// (A) CONVERT ARRAY TO STRING
$data = ["Apple", "Banana", "Cherry"];
$encoded = json_encode($data);
?>
<!-- (B) THIS IS JAVASCRIPT -->
<script>
// (B1) JSON ENCODED STRING
var encoded = '<?=$encoded?>';
console.log(encoded); // STRING
// (B2) JSON PARSE (DECODE)
var data = JSON.parse(encoded);
console.log(data); // ARRAY
<script type="text/javascript">
var jvalue = 'this is javascript value';
<?php $abc = "<script>document.write(jvalue)</script>"?>
</script>
<?php echo 'php_'.$abc;?>
Code Example |
---|
:: laravel unique validation on multiple columns |
:: |
Php :: laravel pagination problem in blade |
:: woocommerce after order been placed hook |
:: |
:: |
:: |
:: |
Php :: how to data save usigng request all laravel |
Php :: |
Php :: |
:: autoload_namespaces.php failed to open stream: Permission denied |
:: |
Php :: |
:: |
:: laravel search |
:: |
Php :: autoload file in laravel |
:: How To Unset Or Delete An Element From Array By Value In PHP? |
:: |
Php :: |
:: |
Php :: |
:: |
Php :: add another column in a table in laravel |
Php :: |
Php :: windows logged in user name in php |
Php :: |
:: |
:: |