# php-get

> Allows to get variables from PHP.

Latest version **1.0.1** (published 2018-04-16) · ISC license · 0 weekly downloads

## Install

```sh
npm install php-get
pnpm add php-get
yarn add php-get
bun add php-get
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2018-04-16 |
| First published | 2018-04-16 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 1.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | mahdrentys |
| Maintainers | mahdrentys |
| Keywords | get, javascript, php, variable, var |

## Links

- npm: https://www.npmjs.com/package/php-get
- npm.io page: https://npm.io/package/php-get

## Recent versions

- 1.0.1 (latest) — 2018-04-16
- 1.0.0 — 2018-04-16

## README

# Php Get

Allows to get variables from PHP.


## Installation
Download and install npm at [www.npmjs.com/get-npm](https://www.npmjs.com/get-npm) if you haven't already.

```sh
npm install php-get --save
```

This package is provided in ES6 module format.


## Usage
To transmit variables to your js, you must write hidden input like this :

```html
<input type="hidden" id="phpGet_var1" value="&quot;My example string&quot;" />
<input type="hidden" id="phpGet_var2" value="[&quot;The first element of my example array&quot;, &quot;The second element of my example array&quot;]" />
```

Notice that the value must be in JSON format, and that the double quotes are replaced with "&amp;quot;". In js, you have to do that :

```js
import phpGet from 'php-get';

var var1 = phpGet('var1');
var var2 = phpGet('var2');

console.log(var1); // We obtains : "My example string"
console.log(var2); // We obtains an array : ["The first element of my example array", "The second element of my example array"]
```

You can specify a default value, in case if the variable is not transmited. For example :

```js
import phpGet from 'php-get';

var var3 = phpGet('var3', "This variable doesn't exists.");
console.log(var3); // We obtains : "This variable doesn't exists"
```


## License
[ISC]()

---
_Source: https://npm.io/package/php-get · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
