# Variableninhalt als Variablendeklaration benutzen

**URL:** https://forum.shopware.com/t/variableninhalt-als-variablendeklaration-benutzen/2267
**Category:** Shopware 3.5
**Tags:** programming
**Created:** [25. März 2011 um 15:07 UTC](https://forum.shopware.com/t/variableninhalt-als-variablendeklaration-benutzen/2267 "2011-03-25T15:07:29Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![ottscho](https://avatars.discourse-cdn.com/v4/letter/o/7ba0ec/32.png) [@ottscho](https://forum.shopware.com/u/ottscho)
#### Post date: [25. März 2011 um 15:07 UTC](https://forum.shopware.com/t/variableninhalt-als-variablendeklaration-benutzen/2267/1 "2011-03-25T15:07:29Z")

</div>

Hey, ich würde gerne den Inhalt einer Variable zum deklarieren einer Neuen benutzen. Geht das? z.B. unter Linux würde ich das so machen: ` $art = '123'; Shopware()-\>Session()-\>`$art`erweitert = 'test'; ` Jmd eine Idee?

---

<div class="post-metadata">

### Author: ![Vamporio](https://avatars.discourse-cdn.com/v4/letter/v/45deac/32.png) [@Vamporio](https://forum.shopware.com/u/Vamporio)
#### Post date: [29. März 2011 um 14:30 UTC](https://forum.shopware.com/t/variableninhalt-als-variablendeklaration-benutzen/2267/2 "2011-03-29T14:30:12Z")

</div>

Also in PHP kannst du das folgendermaßen machen: `<?php $variablenname = 'neuevariable';
 ${$variablenname} = 'Dies ist der Inhalt der neuen Variable';
?>` Vielleicht lässt sich das ja irgendwie auf dein Problem anweden… 😉

---

<div class="post-metadata">

### Author: ![ottscho](https://avatars.discourse-cdn.com/v4/letter/o/7ba0ec/32.png) [@ottscho](https://forum.shopware.com/u/ottscho)
#### Post date: [29. März 2011 um 14:36 UTC](https://forum.shopware.com/t/variableninhalt-als-variablendeklaration-benutzen/2267/3 "2011-03-29T14:36:02Z")

</div>

[quote=“Vamporio”]Also in PHP kannst du das folgendermaßen machen: `<?php $variablenname = 'neuevariable';
 ${$variablenname} = 'Dies ist der Inhalt der neuen Variable';
?>` Vielleicht lässt sich das ja irgendwie auf dein Problem anweden… ;)[/quote] Habe es rausgefunden, hatte nur vergessen hier zu posten 😉 Lösung: ` Shopware()-\>Session()-\>{$articleid.'qm\_value'} = $\_GET[$articleid.'qm\_value']; `

---

<div class="post-metadata">

### Author: ![Vamporio](https://avatars.discourse-cdn.com/v4/letter/v/45deac/32.png) [@Vamporio](https://forum.shopware.com/u/Vamporio)
#### Post date: [29. März 2011 um 15:07 UTC](https://forum.shopware.com/t/variableninhalt-als-variablendeklaration-benutzen/2267/4 "2011-03-29T15:07:43Z")

</div>

Ahh, cool 😉 Na ja ^^ Hauptsache es funktioniert nun 😉
