LMSouq
php-dev Open

How to define an empty object in PHP

ED
ed209
1 month ago
3 views
Problem Description
with a new array I do this: $aVal = array(); $aVal[key1][var1] = "something"; $aVal[key1][var2] = "something else"; Is there a similar syntax for an object (object)$oVal = ""; $oVal->key1->var1 = "something"; $oVal->key1->var2 = "something else";

AI-Generated Solution

Powered by LMSouq AI · GPT-4.1-mini

✓ Solution Ready
Analyzing problem and generating solution…
Was this solution helpful?
Back to Knowledge Base