• Categories
    • PHP
    • phpMyAdmin
    • PHPMailer
    • FFMpeg
    • PHPEXcel
    • PHPDoc
    • PHPUnit
    • CakePHP
    • CakePHP 2.0
    • Cake PHP 2.1
    • CakePHP Model
    • Facebook PHP SDK
    • composer-php
    • PHP 7
    • PHP GD
    All Categories
  • About

What is the difference between client-side and server-side programming?

javascriptphpclient-sideserver-side


PHP Snippet 1:

<script type="text/javascript">
    var foo = 'bar';
    <?php
        file_put_contents('foo.txt', ' + foo + ');
    ?>

    var baz = <?php echo 42; ?>;
    alert(baz);
</script>

PHP Snippet 2:

<script type="text/javascript">
    var foo = 'bar';

    var baz = 42;
    alert(baz);
</script>

Related Snippets

How can I make a full text index of the column?

Check if a string contain multiple specific words

Create a zip file and download it

generating a random code in php?

Facebook API, get page post link (PHP)

Laravel query builder binding parameters more than once

I cannot create a auto generated date time in mysql workbench

Display a product custom field only in WooCommerce Admin single orders

Converting alphabet letter to alphabet position in PHP [duplicate]

Laravel 5.2: Unable to locate factory with name [default]

Best way to scrolldown onpageload

PHP DOTENV unable to load env vars

Loading data from MySQL and populating dropdown select with jQuery Mobile, PHP

Google API Heatmap Layer exception, why?

Need to display only array value in JSON output

About Contact Privacy policy Terms and conditions