Position actuelle: Accueil> Catégories de fonctions> parse_str

parse_str

Analyser les cordes en variables multiples
Nom:parse_str
Catégorie:Chaîne
Langage de programmation:php
Description en une ligne:Analyse la chaîne de requête dans la variable.

Exemple

Exemple 1

Parses Query Strings en variables:

 <span class="token php language-php"><span class="token delimiter important"><? Php</span>
<span class="token function">parse_str</span> <span class="token punctuation">(</span> <span class="token string double-quoted-string">"name = bill & age = 60"</span> <span class="token punctuation">)</span> <span class="token punctuation">;</span>
<span class="token keyword">Echo</span> <span class="token variable">$ nom</span> <span class="token operator">.</span> <span class="token string double-quoted-string">"<br>"</span> <span class="token punctuation">;</span>
<span class="token keyword">écho</span> <span class="token variable">$ âge</span> <span class="token punctuation">;</span>
<span class="token delimiter important">?></span></span>

Essayez-le vous-même

Exemple 2

Stocker les variables dans un tableau:

 <span class="token php language-php"><span class="token delimiter important"><? Php</span>
<span class="token function">parse_str</span> <span class="token punctuation">(</span> <span class="token string double-quoted-string">"name = bill & age = 60"</span> <span class="token punctuation">,</span> <span class="token variable">$ myArray</span> <span class="token punctuation">)</span> <span class="token punctuation">;</span>
<span class="token function">print_r</span> <span class="token punctuation">(</span> <span class="token variable">$ myArray</span> <span class="token punctuation">)</span> <span class="token punctuation">;</span>
<span class="token delimiter important">?></span></span>

Essayez-le vous-même

Fonctions similaires
  • Échappez inversement à une corde échappée stripslashes

    stripslashes

    Échappezinversementà
  • Convertir la corde en minuscules strtolower

    strtolower

    Convertirlacordeenmi
  • Écrire des chaînes formatées pour diffuser vfprintf

    vfprintf

    Écriredeschaînesform
  • Sortir une ou plusieurs chaînes echo

    echo

    Sortiruneouplusieurs
  • Convertir la logique-hebrew en visual-hebrew hebrev

    hebrev

    Convertirlalogique-h
  • Insérez la balise HTML Newline avant toutes les nouvelles lignes d'une chaîne nl2br

    nl2br

    InsérezlabaliseHTMLN
  • Répéter une chaîne str_repeat

    str_repeat

    Répéterunechaîne
  • Convertir la chaîne hexadécimale en chaîne binaire hex2bin

    hex2bin

    Convertirlachaînehex
Articles populaires