Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

assign $variable of key value pair array to multiple variables php

$healthStructureData = [
            'product' => $product,
            'website_data' => $website_data,
            'total_keywords' => $total_keywords,
            'certificate_status' => $certificate_status,
            'total_user_websites' => $total_user_websites,
        ];

foreach ($healthStructureData as $key => $value) {
  $$key = $value;
}
 
PREVIOUS NEXT
Tagged: #assign #key #pair #array #multiple #variables #php
ADD COMMENT
Topic
Name
5+7 =