Download the PHP package refactorstudio/php-array-to-xml without Composer

On this page you can find all versions of the php package refactorstudio/php-array-to-xml. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package php-array-to-xml

PhpArrayToXml

Convert an array to XML with PHP

License

Install

Require the vendor files (these already loaded if you are using something like Symfony or Laravel)

Usage

Basic example:

Output:

Output Format (Prettify)

->setFormatOutput(bool $value = false)

Alias: ->prettify() is the same as typing: ->setFormatOutput(true)

Default:

Usage:

Result:

Custom root name

->setCustomRootName(string $value = 'root')

Result:

Custom tag name

Custom tag names are used when an array has no key names

->setCustomTagName(string $value = 'node')

Default (prettified):

Usage:

Result (prettified):

XML version

->setVersion(string $value = '1.0')

Result (prettified):

XML encoding

->setEncoding(string $value = 'UTF-8')

Result (prettified):

Tag separator

Set the value for the separator that will be used to replace special characters in tag names

->setSeparator(string $value = '_')

Default (prettified):

Usage:

Result (prettified):

Transform tag names

Transform tag names to uppercase/lowercase

->setTransformTags(string $value = null)

Default (prettified):

Usage (lowercase):

Result (prettified):

Usage (uppercase):

Result (prettified):

Usage (uppercase, but with custom tag names, which will not be transformed):

Result (prettified):

Set numeric tag suffix

If this is not null, it appends the numeric array key to the tag name, with the value as separator.

->setNumericTagSuffix(string $value = null)

Default (prettified):

Usage:

Result (prettified):

Cast boolean values

By default boolean values from the array will be cast to the string 'true' or 'false'. You can choose to cast it to any (string) value you like. This method only works on real boolean values, so strings with the value 'true' and 'false' are untouched.

->setCastBooleanValueTrue(string $value = 'true')

->setCastBooleanValueFalse(string $value = 'false')

Default (prettified):

Usage:

Result (prettified):

Cast NULL values

By default null values from the array will have no value in the XML, so the tag looks something like this: <MyTag/>. You can choose to cast it to any (string) value you like. This method only works on real 'null' values, so strings with the value 'null' or empty strings '' are untouched.

->setCastNullValue(null|string $value = null)

Default (prettified):

Usage:

Result (prettified):

Development


All versions of php-array-to-xml with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0|^7.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package refactorstudio/php-array-to-xml contains the following files

Loading the files please wait ....