Download the PHP package keesiemeijer/insert-content without Composer

On this page you can find all versions of the php package keesiemeijer/insert-content. 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 insert-content

Insert Content Between HTML Paragraphs Build Status

PHP functions to insert content between or after HTML paragraphs the right way, without using regular expressions.

Insert content in a string containing HTML markup. The PHP DOM module is used to find and add the content after paragraphs.

Features

Nested Paragraphs

Only top-level (non nested) HTML paragraphs are used to add content after. Let's say you wanted to add content after the second paragraph in this content.

Most functions (or scripts) that are similar to this one would wrongly add your content ater the second <p> inside the <blockquote> element.

Insert Position

By default content is inserted after the middle paragraph. In other words, if the HTML content contains four paragraphs it will be inserted after the second.

No Paragraphs Found

The content you want to insert will be added at the end if no paragraphs were found. Equally so, if you've set it to insert content after a set number of paragraphs, and not enough paragraphs were found, it's inserted after the last found paragraph. If you're using the parent_element_id argument and no paragraphs are found in that element the content will be inserted after the parent element.

Inserted Content

The inserted content will be wrapped in a HTML paragraph element <p></p> by default.

Usage

Include the insert-content.php file in your project to make use of the insert_content() function. Or require it in your project with composer require keesiemeijer/insert-content

The defaults for the optional arguments ($args) are:

Parameters

Examples

Example 1

Add content after the second paragraph in this content:

For this example pretend the above HTML content is stored inside the $content variable.

The output for this example is this.

Example 2

Add content after the second paragraph in an HTML element with the id specific-id.

For this example pretend the above HTML content is stored inside the $content variable.

The output for this example is this.


All versions of insert-content with dependencies

PHP Build Version
Package Version
No informations.
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 keesiemeijer/insert-content contains the following files

Loading the files please wait ....