180 links
  • BigBrainBag
  • Home
  • Login
  • RSS Feed
  • Tag cloud
  • Picture wall
  • Daily
Links per page: 20 50 100
page 1 / 1
14 results tagged php x
  • CSS - Positioning - Tutorialspoint
    Mon Mar 15 18:28:53 2021 - permalink -
    QRCode
    - archive.org - https://www.tutorialspoint.com/css/css_positioning.htm
    course css free online php tutorial
  • terminal - How to read console/user input in PHP? - Stack Overflow


    If you don't have readline installed, -or- you're writing a library, you should do this:

    if (!function_exists('readline')) {
        function readline($question)
        {
            $fh = fopen('php://stdin', 'r');
            echo $question;
            $userInput = trim(fgets($fh));
            fclose($fh);

            return $userInput;
        }
    }

    $age = readline('What is your age? ');
    echo "You are $age years old.\n";

    Fri Mar 12 17:57:29 2021 - permalink -
    QRCode
    - archive.org - https://stackoverflow.com/questions/23622141/how-to-read-console-user-input-in-php
    input php readline shell
  • PHP Tutorial - Tutorialspoint
    Thu Mar 4 21:44:03 2021 - permalink -
    QRCode
    - archive.org - https://www.tutorialspoint.com/php/index.htm
    php tuturials
  • php print_r nice table - Stack Overflow
    Here is a very simple way to print pretty arrays with html pre tag:
    <?php
    $myarray = array('a','b','c');
    echo '<pre>';
    print_r($myarray);
    echo '</pre>';
    ?>
    Sat Feb 6 22:38:10 2021 * - permalink -
    QRCode
    - archive.org - https://stackoverflow.com/questions/1386331/php-print-r-nice-table
    array html php pretty print
  • Display All PHP Errors: Basic & Advanced Usage – Stackify
    Sat Feb 6 22:11:48 2021 - permalink -
    QRCode
    - archive.org - https://stackify.com/display-php-errors/
    display errors output php
  • PHP Email Contact Form | Mailtrap Blog
    Tue Feb 2 14:36:39 2021 - permalink -
    QRCode
    - archive.org - https://blog.mailtrap.io/php-email-contact-form/
    form mail php
  • Send email with PHP from html form on submit with the same script - Stack Overflow
    Tue Feb 2 14:36:16 2021 - permalink -
    QRCode
    - archive.org - https://stackoverflow.com/questions/18379238/send-email-with-php-from-html-form-on-submit-with-the-same-script
    form mail php
  • Symfony, High Performance PHP Framework for Web Development
    Fri May 19 22:53:26 2017 - permalink -
    QRCode
    - archive.org - https://symfony.com/
    component components framework laravel php symfony
  • Simple Way To HTTPS All Laravel Routes
    Simple Way To HTTPS All Laravel Routes
    09 MAY 2017
    I thought this would be a quick search on the internet to make all routes HTTPS in Laravel, but came across a lot of solutions and a lot which seemed like to much code/work for something that i thought would be a quick fix and some of the solutions just did not work for me.

    After a while of searching the simplest way i found was to edit:

    C:\VolledServer\volled\app\Providers\AppServiceProvider  
    and at the top of AppServiceProvider file add:

    use Illuminate\Support\Facades\URL;  
    and then under boot add the below.

    public function boot()  
        {
         URL::forceScheme('https');
        }
    That's how simple it was, now all routes should use HTTPS.
    Thu May 11 10:44:53 2017 - permalink -
    QRCode
    - archive.org - http://seanoneill.me/eaest-way-to-https-on-all-laravel-routes/
    dev http https laravel php route routes
  • How to support full Unicode in MySQL databases · Mathias Bynens
    MySQL’s utf8mb4
    Luckily, MySQL 5.5.3 (released in early 2010) introduced a new encoding called utf8mb4 which maps to proper UTF-8 and thus fully supports Unicode, including astral symbols.

    Switching from MySQL’s utf8 to utf8mb4
    Step 1: Create a backup

    Create a backup of all the databases on the server you want to upgrade. Safety first!

    Step 2: Upgrade the MySQL server

    Upgrade the MySQL server to v5.5.3+, or ask your server administrator to do it for you.

    Step 3: Modify databases, tables, and columns

    Change the character set and collation properties of the databases, tables, and columns to use utf8mb4 instead of utf8.

    # For each database:
    ALTER DATABASE database_name CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci;
    # For each table:
    ALTER TABLE table_name CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
    # For each column:
    ALTER TABLE table_name CHANGE column_name column_name VARCHAR(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
    # (Don’t blindly copy-paste this! The exact statement depends on the column type, maximum length, and other properties. The above line is just an example for a `VARCHAR` column.)
    Since utf8mb4 is fully backwards compatible with utf8, no mojibake or other forms of data loss should occur. (But you have a backup, right?)

    Step 4: Check the maximum length of columns and index keys

    This is probably the most tedious part of the whole upgrading process.

    When converting from utf8 to utf8mb4, the maximum length of a column or index key is unchanged in terms of bytes. Therefore, it is smaller in terms of characters, because the maximum length of a character is now four bytes instead of three.

    For example, a TINYTEXT column can hold up to 255 bytes, which correlates to 85 three-byte or 63 four-byte characters. Let’s say you have a TINYTEXT column that uses utf8 but must be able to contain more than 63 characters. Given this requirement, you can’t convert this column to utf8mb4 unless you also change the data type to a longer type such as TEXT — because if you’d try to fill it with four-byte characters, you’d only be able to enter 63 characters, but not more.

    The same goes for index keys. The InnoDB storage engine has a maximum index length of 767 bytes, so for utf8 or utf8mb4 columns, you can index a maximum of 255 or 191 characters, respectively. If you currently have utf8 columns with indexes longer than 191 characters, you will need to index a smaller number of characters when using utf8mb4. (Because of this, I had to change some indexed VARCHAR(255) columns to VARCHAR(191).)

    Section 10.1.11 of the MySQL 5.5 Reference Manual has some more information on this.

    Step 5: Modify connection, client, and server character sets

    In your application code, set the connection character set to utf8mb4. This can be done by simply replacing any variants of SET NAMES utf8 with SET NAMES utf8mb4. If your old SET NAMES statement specified the collation, make sure to change that as well, e.g. SET NAMES utf8 COLLATE utf8_unicode_ci becomes SET NAMES utf8mb4 COLLATE utf8mb4_unicode_ci.

    Make sure to set the client and server character set as well. I have the following in my MySQL configuration file (/etc/my.cnf):

    [client]
    default-character-set = utf8mb4

    [mysql]
    default-character-set = utf8mb4

    [mysqld]
    character-set-client-handshake = FALSE
    character-set-server = utf8mb4
    collation-server = utf8mb4_unicode_ci
    You can easily confirm these settings work correctly:

    mysql> SHOW VARIABLES WHERE Variable_name LIKE 'character\_set\_%' OR Variable_name LIKE 'collation%';
    +--------------------------+--------------------+
    | Variable_name            | Value              |
    +--------------------------+--------------------+
    | character_set_client     | utf8mb4            |
    | character_set_connection | utf8mb4            |
    | character_set_database   | utf8mb4            |
    | character_set_filesystem | binary             |
    | character_set_results    | utf8mb4            |
    | character_set_server     | utf8mb4            |
    | character_set_system     | utf8               |
    | collation_connection     | utf8mb4_unicode_ci |
    | collation_database       | utf8mb4_unicode_ci |
    | collation_server         | utf8mb4_unicode_ci |
    +--------------------------+--------------------+
    10 rows in set (0.00 sec)
    As you can see, all the relevant options are set to utf8mb4, except for character_set_filesystem which should be binary unless you’re on a file system that supports multi-byte UTF-8-encoded characters in file names, and character_set_system which is always utf8 and can’t be overridden.

    Note: The default character set and collation can be configured at some other levels as well.

    Step 6: Repair and optimize all tables

    After upgrading the MySQL server and making the necessary changes explained above, make sure to repair and optimize all databases and tables. I didn’t do this right away after upgrading (I didn’t think it was necessary, as everything seemed to work fine at first glance), and ran into some weird bugs where UPDATE statements didn’t have any effect, even though no errors were thrown.

    You could run the following MySQL queries for each table you want to repair and optimize:

    # For each table
    REPAIR TABLE table_name;
    OPTIMIZE TABLE table_name;
    Luckily, this can easily be done in one go using the command-line mysqlcheck utility:

    $ mysqlcheck -u root -p --auto-repair --optimize --all-databases
    This will prompt for the root user’s password, after which all tables in all databases will be repaired and optimized.
    Tue Mar 28 09:33:48 2017 - permalink -
    QRCode
    - archive.org - https://mathiasbynens.be/notes/mysql-utf8mb4
    character collation database db emoji mysql php unicode utf8 utf8mb4
  • json - PHP "pretty print" json_encode - Stack Overflow
    189
    down vote
    accepted
    PHP has JSON_PRETTY_PRINT option since 5.4.0 (release date 01-Mar-2012).

    This should do the job:

    $json = json_decode($string);
    echo json_encode($json, JSON_PRETTY_PRINT);
    See http://www.php.net/manual/en/function.json-encode.php

    Note: Don't forget to echo "<pre>" before and </pre> after, if you're printing it in HTML ;)

    shareimprove this answer
    answered Nov 30 '12 at 4:27

    petrkotek
    2,55211014
    10  
    In PHP <5.4 replace JSON_PRETTY_PRINT with 128 – Nic Cottrell Aug 19 '14 at 13:36
    1  
    @NicCottrell doesn't work when i test it here sandbox.onlinephpfunctions.com/code/… – drzaus Aug 28 '14 at 5:15
        
    @drzaus works for me there - I can see each key of JSON on separate line (the PHP version used on that site has even JSON_PRETTY_PRINT defined. – petrkotek Aug 28 '14 at 6:07
        
    @beret ahh, I thought sharing it would retain the PHP setting -- change the php version to anything less than 5.4 and it should go back to "unformatted" – drzaus Aug 28 '14 at 13:29
    3  
    Thank you for the <pre>json</pre> tip! – GisMofx Feb 18 '16 at 4:05
    show 2 more comments
    up vote
    11
    down vote
    Hmmm $array = json_decode($json, true); will make your string an array which is easy to print nicely with print_r($array, true);

    But if you really want to prettify your json... Check this out

    shareimprove this answer
    answered Aug 17 '11 at 18:12

    sg3s
    7,82022348
        
    +1 for print_r – Michael Mior Aug 17 '11 at 19:35
        
    @Michael Mior you should see my debugging die die(print('<pre>'.print_r($var, true).'</pre>')) it prints almost anything :p – sg3s Aug 17 '11 at 19:38
    1  
    I usually just view the source and go with var_dump, but whatever works :) – Michael Mior Aug 17 '11 at 21:09
    add a comment
    up vote
    4
    down vote
    Here's a function to pretty up your json: pretty_json
    Fri Mar 17 16:57:26 2017 - permalink -
    QRCode
    - archive.org - http://stackoverflow.com/questions/7097374/php-pretty-print-json-encode
    code debug dev dump good important json php pretty print_r
  • Administrator's Guide, Parallels Plesk Panel 11.5
    Fri Mar 10 15:42:42 2017 - permalink -
    QRCode
    - archive.org - http://download1.parallels.com/Plesk/PP11/11.5/Doc/de-DE/online/plesk-administrator-guide/index.htm?fileName=70742.htm
    apache cgi fastCGI handler module php php-fpm server
  • Tutorialzine Newsletter
    Fri Mar 10 11:54:40 2017 - permalink -
    QRCode
    - archive.org - http://tutorialzine.com/newsletter/w/7633tN763hn8922mnDomOErf3kfg/PYJt4cw3rGUTSKDTdf2r5A/HUeqsbABB4HQwb4ZKZllnA
    dev good guides libs php resources web
  • GitHub - ConsoleTVs/Charts: Multi-library chart package to create interactive charts using laravel.
    Multi-library chart package to create interactive charts using laravel. https://erik.cat/projects/Charts
    Fri Mar 10 11:50:51 2017 - permalink -
    QRCode
    - archive.org - https://github.com/ConsoleTVs/Charts
    charts cool laravel lib php
Links per page: 20 50 100
page 1 / 1
Shaarli - The personal, minimalist, super-fast, database free, bookmarking service by the Shaarli community - Help/documentation