Viewed   82 times

How would one go about showing PHP code on user end. Sort of like w3School does?

Having lets say a grey area div, and then showing the code in there without activating it?



You can use html entities &lt;?php in the html it will be rendered as <?php

You can use htmlspecialchars to encode your code to use html entities.

Tuesday, September 27, 2022

Here's what worked best for me when trying to script this (in case anyone else comes across this like I did):

$ pecl -d php_suffix=5.6 install <package>
$ pecl uninstall -r <package>

$ pecl -d php_suffix=7.0 install <package>
$ pecl uninstall -r <package>

$ pecl -d php_suffix=7.1 install <package>
$ pecl uninstall -r <package>

The -d php_suffix=<version> piece allows you to set config values at run time vs pre-setting them with pecl config-set. The uninstall -r bit does not actually uninstall it (from the docs):

vagrant@homestead:~$ pecl help uninstall
pecl uninstall [options] [channel/]<package> ...
Uninstalls one or more PEAR packages.  More than one package may be
specified at once.  Prefix with channel name to uninstall from a
channel not in your default channel (

  -r, --register-only
        do not remove files, only register the packages as not installed

The uninstall line is necessary otherwise installing it will remove any previously installed version, even if it was for a different PHP version (ex: Installing an extension for PHP 7.0 would remove the 5.6 version if the package was still registered as installed).

Monday, December 12, 2022

You cannot get the exact code, but you can get a decompiled version of it.

The most popular (and best) tool is Reflector, but there are also other .Net decompilers (such as Dis#). You can also decompile the IL using ILDASM, which comes bundled with the .Net Framework SDK Tools.

Monday, September 12, 2022

Never used any of those, but they look interesting..

Take a look at Gearman as well.. more overhead in systems like these but you get other cool stuff :) Guess it depends on your needs ..

Friday, November 11, 2022

Add natty repository:

$sudo echo "deb natty main universe multiverse" >> /etc/apt/sources.list
$sudo apt-get update

Create /etc/apt/preferences(change lucid, to your release):

Package: *
Pin: release a=natty
Pin-Priority: -10

Package: *
Pin: release a=lucid
Pin-Priority: 900

Install last php5-curl:

$sudo apt-get install -t natty php5-curl


$php -i | grep -i curl
cURL Information => 7.21.3

php -r 'var_dump(curl_version());'

or download php5 and curl source codes and build.

Wednesday, August 17, 2022
Only authorized users can answer the search term. Please sign in first, or register a free account.
Not the answer you're looking for? Browse other questions tagged :