I am trying to print my content from the ckeditor I uploaded to the db.
In the admin panel editing ckeditor it's normal,
but once I print it in the site via:
<?if (!empty($show['participants'])){?>
<Div class="participants">
<?=$show['participants']?>
</Div>
<?}?>
It's echo the tags only:
<p><strong>אנדרס מוסטונן</strong>, מנצח (אסטוניה)<br><strong>קרן הדר, </strong>סופרן (ישראל)<br><strong>ארה סאל</strong>, בריטון (אסטוניה)<br><strong>מקהלת עמק חפר </strong><br><strong>מקהלה אסטונית</strong><br><br><br><strong>בתוכנית:</strong><br><strong>אורף</strong>: כרמינה בורנה<br><strong>יואב תלמי</strong>: אלגריה למיתרים, טימפני ואקורדיון</p>
Var dumped $show:
array(27) { ["id"]=> string(3) "432" ["code"]=> string(36) "63c8bc24-f730-e811-bd2b-10604ba9908f" ["name"]=> string(10) "הקיסר" ["title_short"]=> string(163) "מפגש ענקים - כריסטיאן יארווי ורומן רבינוביץ' בביצוע "הפנטסטית" של ברליוז ו"הקיסר" של בטהובן" ["title_long"]=> string(0) "" ["description"]=> string(29) "<p> </p>" ["participants"]=> string(612) "<p><strong>כריסטיאן יארווי</strong>,מנצח (אסטוניה)<br><strong>רומן רבינוביץ'</strong>, פסנתר (ישראל)<br><br><strong>בתוכנית:</strong><br><strong>בן חיים</strong>: "תרועה לישראל"<br><strong>בטהובן</strong>: קונצ'רטו לפסנתר מס' 5 – הקיסר<br><strong>ברליוז</strong>: סימפוניה פנטסטית<br><strong>ארוו פרט</strong>: Fratres</p>" ["image"]=> string(11) "keisarx.jpg" ["image_banner"]=> string(15) "julioskeiar.jpg" ["img_credits"]=> string(18) "בלש בורוץ'" ["video"]=> string(0) "" ["category_id"]=> string(2) "60" ["category_order"]=> string(1) "0" ["show_on_main"]=> string(1) "1" ["main_order"]=> string(1) "2" ["show_on_slide"]=> string(1) "0" ["slide_order"]=> string(1) "1" ["home_page"]=> NULL ["direct_link"]=> string(58) "http://tickets.isorl.co.il/he-IL/shows/הקיסר/events/1" ["english_name"]=> NULL ["english_direct_link"]=> NULL ["update_timestamp"]=> string(19) "2018-08-09 12:52:29" ["update_auto_timestamp"]=> string(19) "2018-09-02 12:12:33" ["active"]=> string(1) "1" ["is_amfi_show"]=> string(1) "0" ["is_kunhiya_show"]=> string(1) "0" ["events"]=> array(3) { ["by_id"]=> array(2) { [1191]=> &array(20) { ["id"]=> string(4) "1191" ["code"]=> string(36) "e7869a2b-ff30-e811-bd2b-10604ba9908f" ["date"]=> string(10) "2018-10-07" ["time"]=> string(8) "20:00:00" ["show_id"]=> string(3) "432" ["venue_code"]=> NULL ["venue_name"]=> string(43) "היכל התרבות ראשון לציון" ["english_venue_name"]=> NULL ["city"]=> NULL ["english_city"]=> NULL ["country"]=> NULL ["english_country"]=> NULL ["start_sale_date"]=> NULL ["end_sale_date"]=> NULL ["direct_link"]=> string(99) "http://tickets.isorl.co.il/he-IL/events/הקיסר/2018-10-7_20.00/היכל ראשון לציון/1" ["english_direct_link"]=> string(67) "http://tickets.isorl.co.il/loader.aspx/?target=hall.aspx?event=3709" ["is_active"]=> string(1) "1" ["update_timestamp"]=> string(19) "2018-08-09 12:52:29" ["is_for_sale"]=> string(1) "1" ["show_on_upcoming"]=> string(1) "0" } [1193]=> &array(20) { ["id"]=> string(4) "1193" ["code"]=> string(36) "49a650f7-f630-e811-bd2b-10604ba9908f" ["date"]=> string(10) "2018-10-09" ["time"]=> string(8) "20:00:00" ["show_id"]=> string(3) "432" ["venue_code"]=> NULL ["venue_name"]=> string(71) "המשכן לאמנויות הבמה, בית האופרה תל אביב" ["english_venue_name"]=> NULL ["city"]=> NULL ["english_city"]=> NULL ["country"]=> NULL ["english_country"]=> NULL ["start_sale_date"]=> NULL ["end_sale_date"]=> NULL ["direct_link"]=> string(88) "http://tickets.isorl.co.il/he-IL/events/הקיסר/2018-10-9_20.00/בית האופרה/1" ["english_direct_link"]=> string(67) "http://tickets.isorl.co.il/loader.aspx/?target=hall.aspx?event=3695" ["is_active"]=> string(1) "1" ["update_timestamp"]=> string(19) "2018-08-09 12:52:29" ["is_for_sale"]=> string(1) "1" ["show_on_upcoming"]=> string(1) "0" } } ["by_order"]=> array(2) { [0]=> &array(20) { ["id"]=> string(4) "1191" ["code"]=> string(36) "e7869a2b-ff30-e811-bd2b-10604ba9908f" ["date"]=> string(10) "2018-10-07" ["time"]=> string(8) "20:00:00" ["show_id"]=> string(3) "432" ["venue_code"]=> NULL ["venue_name"]=> string(43) "היכל התרבות ראשון לציון" ["english_venue_name"]=> NULL ["city"]=> NULL ["english_city"]=> NULL ["country"]=> NULL ["english_country"]=> NULL ["start_sale_date"]=> NULL ["end_sale_date"]=> NULL ["direct_link"]=> string(99) "http://tickets.isorl.co.il/he-IL/events/הקיסר/2018-10-7_20.00/היכל ראשון לציון/1" ["english_direct_link"]=> string(67) "http://tickets.isorl.co.il/loader.aspx/?target=hall.aspx?event=3709" ["is_active"]=> string(1) "1" ["update_timestamp"]=> string(19) "2018-08-09 12:52:29" ["is_for_sale"]=> string(1) "1" ["show_on_upcoming"]=> string(1) "0" } [1]=> &array(20) { ["id"]=> string(4) "1193" ["code"]=> string(36) "49a650f7-f630-e811-bd2b-10604ba9908f" ["date"]=> string(10) "2018-10-09" ["time"]=> string(8) "20:00:00" ["show_id"]=> string(3) "432" ["venue_code"]=> NULL ["venue_name"]=> string(71) "המשכן לאמנויות הבמה, בית האופרה תל אביב" ["english_venue_name"]=> NULL ["city"]=> NULL ["english_city"]=> NULL ["country"]=> NULL ["english_country"]=> NULL ["start_sale_date"]=> NULL ["end_sale_date"]=> NULL ["direct_link"]=> string(88) "http://tickets.isorl.co.il/he-IL/events/הקיסר/2018-10-9_20.00/בית האופרה/1" ["english_direct_link"]=> string(67) "http://tickets.isorl.co.il/loader.aspx/?target=hall.aspx?event=3695" ["is_active"]=> string(1) "1" ["update_timestamp"]=> string(19) "2018-08-09 12:52:29" ["is_for_sale"]=> string(1) "1" ["show_on_upcoming"]=> string(1) "0" } } ["by_date"]=> array(2) { ["2018-10-07"]=> array(1) { [0]=> &array(20) { ["id"]=> string(4) "1191" ["code"]=> string(36) "e7869a2b-ff30-e811-bd2b-10604ba9908f" ["date"]=> string(10) "2018-10-07" ["time"]=> string(8) "20:00:00" ["show_id"]=> string(3) "432" ["venue_code"]=> NULL ["venue_name"]=> string(43) "היכל התרבות ראשון לציון" ["english_venue_name"]=> NULL ["city"]=> NULL ["english_city"]=> NULL ["country"]=> NULL ["english_country"]=> NULL ["start_sale_date"]=> NULL ["end_sale_date"]=> NULL ["direct_link"]=> string(99) "http://tickets.isorl.co.il/he-IL/events/הקיסר/2018-10-7_20.00/היכל ראשון לציון/1" ["english_direct_link"]=> string(67) "http://tickets.isorl.co.il/loader.aspx/?target=hall.aspx?event=3709" ["is_active"]=> string(1) "1" ["update_timestamp"]=> string(19) "2018-08-09 12:52:29" ["is_for_sale"]=> string(1) "1" ["show_on_upcoming"]=> string(1) "0" } } ["2018-10-09"]=> array(1) { [0]=> &array(20) { ["id"]=> string(4) "1193" ["code"]=> string(36) "49a650f7-f630-e811-bd2b-10604ba9908f" ["date"]=> string(10) "2018-10-09" ["time"]=> string(8) "20:00:00" ["show_id"]=> string(3) "432" ["venue_code"]=> NULL ["venue_name"]=> string(71) "המשכן לאמנויות הבמה, בית האופרה תל אביב" ["english_venue_name"]=> NULL ["city"]=> NULL ["english_city"]=> NULL ["country"]=> NULL ["english_country"]=> NULL ["start_sale_date"]=> NULL ["end_sale_date"]=> NULL ["direct_link"]=> string(88) "http://tickets.isorl.co.il/he-IL/events/הקיסר/2018-10-9_20.00/בית האופרה/1" ["english_direct_link"]=> string(67) "http://tickets.isorl.co.il/loader.aspx/?target=hall.aspx?event=3695" ["is_active"]=> string(1) "1" ["update_timestamp"]=> string(19) "2018-08-09 12:52:29" ["is_for_sale"]=> string(1) "1" ["show_on_upcoming"]=> string(1) "0" } } } } }
What is going wrong? Thanks.
Related
I try to extract and to show on the page with echo product code field in K2store cart page (store extension for K2 for Joomla) but without success. The right value is "product_code" or "code" (is the same value): 26910.
Both "echo $item->product_name" and "echo $item->product_id" works, but "echo $item->code" and "echo $item->product_code" return NULL.
var_dump($item) show me this:
object(stdClass)#381 (13) {
["key"]=>
int(9928417)
["product_id"]=>
string(7) "9928417"
["product_name"]=>
string(71) "some title"
["product_model"]=>
NULL
["product_total"]=>
int(1)
["product_options"]=>
object(stdClass)#382 (0) {
}
["quantity"]=>
int(1)
["stock"]=>
object(JObject)#378 (18) {
["_errors":protected]=>
array(0) {
}
["item_enabled"]=>
string(1) "1"
["item_sku"]=>
NULL
["item_price"]=>
NULL
["special_price"]=>
NULL
["item_tax_id"]=>
NULL
["item_shipping"]=>
NULL
["item_qty"]=>
NULL
["item_cart_text"]=>
NULL
["product_id"]=>
string(7) "9928417"
["product_name"]=>
string(71) "some title"
["product_code"]=>
string(5) "26910"
["price"]=>
NULL
["product_sku"]=>
NULL
["tax_profile_id"]=>
NULL
["item_minimum"]=>
string(1) "1"
["stock"]=>
*RECURSION*
["product"]=>
object(stdClass)#354 (38) {
["id"]=>
string(7) "9928417"
["code"]=>
string(5) "26910"
["title"]=>
string(71) "some title"
["alias"]=>
string(71) "some title"
["catid"]=>
string(3) "694"
["published"]=>
string(1) "1"
["introtext"]=>
string(0) ""
["fulltext"]=>
string(0) ""
["video"]=>
NULL
["gallery"]=>
NULL
["extra_fields"]=>
string(29) "[{"id":"1","value":"25\/40"}]"
["extra_fields_search"]=>
string(6) "25/40 "
["created"]=>
string(19) "2012-09-14 10:20:09"
["created_by"]=>
string(2) "52"
["created_by_alias"]=>
string(0) ""
["checked_out"]=>
string(1) "0"
["checked_out_time"]=>
string(19) "0000-00-00 00:00:00"
["modified"]=>
string(19) "2012-09-14 10:30:46"
["modified_by"]=>
string(2) "52"
["publish_up"]=>
string(19) "2012-09-14 10:20:09"
["publish_down"]=>
string(19) "0000-00-00 00:00:00"
["trash"]=>
string(1) "0"
["access"]=>
string(1) "1"
["ordering"]=>
string(1) "1"
["featured"]=>
string(1) "0"
["featured_ordering"]=>
string(1) "0"
["image_caption"]=>
string(0) ""
["image_credits"]=>
string(0) ""
["video_caption"]=>
string(0) ""
["video_credits"]=>
string(0) ""
["hits"]=>
string(5) "17852"
["params"]=>
string(1190) "catItemTitle=
catItemTitleLinked=
catItemFeaturedNotice=
catItemAuthor=
catItemDateCreated=
catItemRating=
catItemImage=
catItemIntroText=
catItemExtraFields=
catItemHits=
catItemCategory=
catItemTags=
catItemAttachments=
catItemAttachmentsCounter=
catItemVideo=
catItemVideoWidth=
catItemVideoHeight=
catItemVideoAutoPlay=
catItemImageGallery=
catItemDateModified=
catItemReadMore=
catItemCommentsAnchor=
catItemK2Plugins=
itemDateCreated=
itemTitle=
itemFeaturedNotice=
itemAuthor=
itemFontResizer=
itemPrintButton=
itemEmailButton=
itemSocialButton=
itemVideoAnchor=
itemImageGalleryAnchor=
itemCommentsAnchor=
itemRating=
itemImage=
itemImgSize=
itemImageMainCaption=
itemImageMainCredits=
itemIntroText=
itemFullText=
itemExtraFields=
itemDateModified=
itemHits=
itemTwitterLink=
itemCategory=
itemTags=
itemShareLinks=
itemAttachments=
itemAttachmentsCounter=
itemRelated=
itemRelatedLimit=
itemVideo=
itemVideoWidth=
itemVideoHeight=
itemVideoAutoPlay=
itemVideoCaption=
itemVideoCredits=
itemImageGallery=
itemNavigation=
itemComments=
itemAuthorBlock=
itemAuthorImage=
itemAuthorDescription=
itemAuthorURL=
itemAuthorEmail=
itemAuthorLatest=
itemAuthorLatestLimit=
itemK2Plugins=
"
["metadesc"]=>
string(0) ""
["metadata"]=>
string(15) "robots=
author="
["metakey"]=>
string(0) ""
["plugins"]=>
string(27) "{"k2storeitem_enabled":"1"}"
["code_search"]=>
string(0) ""
["language"]=>
string(0) ""
}
}
["tax_amount"]=>
int(0)
["price"]=>
int(0)
["price_without_tax"]=>
int(0)
["total"]=>
int(0)
["total_without_tax"]=>
int(0)
}
The solution is: $item->stock->product_code
I'm using cakephp 2.x and I would like to get certain element as field from my model. the problem is with my structure. If I use find all then I recieve this:
array(9) {
[0]=> ...
[1]=>
array(7) {
["Person"]=>
array(18) {
["id"]=>
int(2)
["imie"]=>
string(6) "STEFAN"
["nazwisko"]=>
string(8) "ŚMIAŁY"
["tel"]=>
string(13) "+55 648989748"
["mob"]=>
string(13) "+87 489747489"
["email"]=>
string(25) "HSDJKAHSDJK#HSDFJASHF.CIJ"
["tytul_naukowy"]=>
string(7) "TEZ NIE"
["data_od"]=>
string(10) "2017-02-16"
["data_do"]=>
NULL
["object_id"]=>
int(-1)
["object_type_id"]=>
int(2)
["duty_id"]=>
int(28)
["created"]=>
string(22) "2017-02-16 13:22:32+01"
["modified"]=>
string(22) "2017-02-16 13:22:32+01"
["deleted"]=>
int(0)
["additional_email"]=>
string(17) "UDIHAS#HFSDKFH.OK"
["description"]=>
string(4) "OPIS"
["displayName"]=>
string(15) "STEFAN ŚMIAŁY"
}
["Duty"]=>
array(3) {
["id"]=>
int(28)
["nazwa"]=>
string(20) "KOORDYNATOR RECEPCJI"
["atrybut"]=>
string(1) "W"
}
["ObjectType"]=>
array(3) {
["id"]=>
int(2)
["nazwa"]=>
string(4) "Obks"
["model"]=>
string(3) "Obk"
}
["Cro"]=>
array(12) {
["id"]=>
NULL
["created"]=>
NULL
["nazwa"]=>
NULL
["tel"]=>
NULL
["fax"]=>
NULL
["email"]=>
NULL
["www"]=>
NULL
["modified"]=>
NULL
["deleted"]=>
NULL
["cro_type_id"]=>
NULL
["displayName"]=>
NULL
["objectTypeIdWithId"]=>
NULL
}
["Attachment"]=>
array(0) {
}
["Specialization"]=>
array(0) {
}
["Obk"]=>
array(1) {
[0]=>
array(13) {
["id"]=>
int(2)
["nazwa"]=>
string(10) "OBK Z ID 2"
["tel"]=>
string(13) "+48 123456890"
["fax"]=>
string(13) "+48 123456789"
["email"]=>
string(15) "EMAIL#EMAIL.COM"
["www"]=>
string(11) "WWW.WWW.WWW"
["modified"]=>
string(22) "2017-03-20 15:11:31+01"
["created"]=>
string(22) "2014-05-12 21:50:17+02"
["deleted"]=>
int(0)
["local_order"]=>
int(3)
["displayName"]=>
string(10) "OBK Z ID 2"
["objectTypeIdWithId"]=>
string(3) "2_2"
["PeopleObk"]=>
array(3) {
["id"]=>
int(1)
["person_id"]=>
int(2)
["obk_id"]=>
int(2)
}
}
}
}
[2]=>
array(7) {
["Person"]=>
array(18) {
["id"]=>
int(3)
["imie"]=>
string(5) "KAMIL"
["nazwisko"]=>
string(10) "STEFAŃSKI"
["tel"]=>
string(13) "+23 123123123"
["mob"]=>
string(13) "+21 412312312"
["email"]=>
string(16) "ASDASD#SDFDSF.LS"
["tytul_naukowy"]=>
string(3) "NIE"
["data_od"]=>
string(10) "2017-02-22"
["data_do"]=>
NULL
["object_id"]=>
int(-1)
["object_type_id"]=>
int(2)
["duty_id"]=>
int(26)
["created"]=>
string(22) "2017-02-22 16:14:32+01"
["modified"]=>
string(22) "2017-02-22 16:14:32+01"
["deleted"]=>
int(0)
["additional_email"]=>
string(22) "ADAM.2313#WEBIMPULS.PL"
["description"]=>
string(4) "TEST"
["displayName"]=>
string(16) "KAMIL STEFAŃSKI"
}
["Duty"]=>
array(3) {
["id"]=>
int(26)
["nazwa"]=>
string(41) "KOORDYNATOR OŚRODKÓW BADAŃ KLINICZNYCH"
["atrybut"]=>
string(1) "W"
}
["ObjectType"]=>
array(3) {
["id"]=>
int(2)
["nazwa"]=>
string(4) "Obks"
["model"]=>
string(3) "Obk"
}
["Cro"]=>
array(12) {
["id"]=>
NULL
["created"]=>
NULL
["nazwa"]=>
NULL
["tel"]=>
NULL
["fax"]=>
NULL
["email"]=>
NULL
["www"]=>
NULL
["modified"]=>
NULL
["deleted"]=>
NULL
["cro_type_id"]=>
NULL
["displayName"]=>
NULL
["objectTypeIdWithId"]=>
NULL
}
["Attachment"]=>
array(0) {
}
["Specialization"]=>
array(0) {
}
["Obk"]=>
array(1) {
[0]=>
array(13) {
["id"]=>
int(3)
["nazwa"]=>
string(10) "OBK Z ID 3"
["tel"]=>
string(13) "+48 123456890"
["fax"]=>
string(13) "+48 123456789"
["email"]=>
string(15) "EMAIL#EMAIL.COM"
["www"]=>
string(11) "WWW.WWW.WWW"
["modified"]=>
string(22) "2017-03-20 10:45:24+01"
["created"]=>
string(22) "2014-05-16 09:09:33+02"
["deleted"]=>
int(0)
["local_order"]=>
int(1)
["displayName"]=>
string(10) "OBK Z ID 3"
["objectTypeIdWithId"]=>
string(3) "2_3"
["PeopleObk"]=>
array(3) {
["id"]=>
int(2)
["person_id"]=>
int(3)
["obk_id"]=>
int(3)
}
}
}
}
And I want just to retrieve Person.id, Person.displayName and Obk.0.id. The two first are no problem, but wheneve I try to get Obk.0.id I'm getting error: SQLSTATE[42P01]: Undefined table: 7 ERROR: missing FROM for Table Obk.
How can I get something like that? I want to set the value in codition later, but it block my work.
In CakePHP 2 you can specify the fields you want returned by a find() query using the fields option like:-
$this->Foo->find('all', [
'fields' => ['Foo.id', 'Foo.name']
]);
This also works with contained models that have a belongsTo or hasOne relationship:-
$this->Foo->find('all', [
'fields' => ['Foo.id', 'Foo.name', 'Bar.name'],
'contain' => ['Bar']
]);
However, if the contained model is a hasMany or HABTM relationship you need to specify the fields of that model on the contain:-
$this->Foo->find('all', [
'fields' => ['Foo.id', 'Foo.name'],
'contain' => [
'Bar' => ['fields' => 'Bar.name']
]
]);
This is because CakePHP will be performing multiple SQL queries, so the contain needs to have the parameters for the query being run for the relevant model.
I got trouble with bulding tree of categories in php.
It's builds tree for very long time and after that i got error:
Fatal error: Out of memory (allocated 637796352) (tried to allocate
208666926 bytes) in
D:\OpenServer\domains\site.local\Core\Widgets.php on line 488
Here is my functions to build tree.
First i made an array of categories:
public function makeCategoriesArray()
{
// $row = DB::select()
// ->from('catalog_tree')
// ->where('parent_id', '=', $this->post['parent_id'])
// ->union(DB::select()
// ->from('catalog_tree')
// ->where('id', 'in', DB::expr("(SELECT catalog_tree_id FROM catalog_tree_parents WHERE parent_id = '".$this->post['parent_id']."')")))
// ->find_all();
$row = DB::select()
->from('catalog_tree')
->where('status', '=', '1')
->find_all();
$categories_arr = array();
foreach ($row as $cat) {
$categories_arr[$cat->parent_id][] = $cat;
}
unset($cat);
unset($row);
foreach($categories_arr as $key=>$value) {
$row = DB::select()
->from('catalog_tree')
->where('id', 'in', DB::expr("(SELECT catalog_tree_id FROM catalog_tree_parents WHERE parent_id = '".$key."')"))
->find_all();
foreach($row as $cat) {
$categories_arr[$key][] = $cat;
}
unset($cat);
unset($row);
}
return $categories_arr;
}
Then i begin to build tree with this array:
public function BuildMainTree($array, $pid) {
global $MainMenu;
if (isset($array[$pid])) { // If category with $pid exist
$MainMenu.= "<ul class=\"dropdown-menu\" role=\"menu\">";
foreach ($array[$pid] as $value)
{
if ($pid!='0' && !isset($array[$value->id])) {
$MainMenu.= '<li class="divider"></li>
<li class="dropdown">
<a href="/catalog/' . $value->alias . '">
'. $value->name .'
</a>
</li>';
}
else {
$MainMenu.= '<li class="divider"></li>
<li class="dropdown">
<a href="/catalog/' . $value->alias . '">
'. $value->name .'
<span class="caret"></span>
</a>
</li>';
$this->BuildMainTree($array, $value->id);
}
}
if ($pid=='0') {
$MainMenu .= "</ul>";
}
else {
$MainMenu .= "</ul></li>";
}
}
}
Initialization of this process are in this function:
public function Header() {
$contentMenu = Common::factory('sitemenu')->getRows(1, 'sort');
$array['contentMenu'] = $contentMenu;
$array['user'] = User::info();
$array['countItemsInTheCart'] = Cart::factory()->_count_goods;
$categories_arr = $this->makeCategoriesArray();
$this->BuildMainTree($categories_arr, 0);
$array['mainMenu'] = $MainMenu;
return $array;
}
Also if i just make array with makeCategoriesArray() it's works fine, but BuildMainTree($array, $pid) function causes an error...
Most funny part, is that this code works perfect on other site.
Maybe I just missed some details here... Spent two days of tried to run this code, but got nothing.
Here is array var_dump:
array(156) {
[0]=>
array(21) {
[0]=>
object(stdClass)#17 (18) {
["id"]=>
string(4) "2075"
["created_at"]=>
string(10) "1470080793"
["updated_at"]=>
string(10) "1473775697"
["status"]=>
string(1) "1"
["sort"]=>
string(1) "0"
["name"]=>
string(27) "Садовая мебель"
["alias"]=>
string(14) "sadovaja-mebel"
["ikea_alias"]=>
string(7) "outdoor"
["parent_id"]=>
string(1) "0"
["image"]=>
string(36) "dc30302d5e76ddf7d3be9cb0f8b4d711.jpg"
["h1"]=>
NULL
["title"]=>
NULL
["keywords"]=>
NULL
["description"]=>
NULL
["text"]=>
NULL
["views"]=>
string(3) "129"
["course"]=>
string(4) "9.50"
["discount_percent"]=>
string(1) "0"
}
[1]=>
object(stdClass)#19 (18) {
["id"]=>
string(4) "2076"
["created_at"]=>
string(10) "1470080793"
["updated_at"]=>
string(10) "1473950659"
["status"]=>
string(1) "1"
["sort"]=>
string(1) "0"
["name"]=>
string(39) "Оформление интерьера"
["alias"]=>
string(19) "oformlenie-interera"
["ikea_alias"]=>
string(10) "decoration"
["parent_id"]=>
string(1) "0"
["image"]=>
string(36) "91b3786d06e22081abbb945b9e4e02d8.jpg"
["h1"]=>
NULL
["title"]=>
NULL
["keywords"]=>
NULL
["description"]=>
NULL
["text"]=>
NULL
["views"]=>
string(3) "287"
["course"]=>
string(4) "9.50"
["discount_percent"]=>
string(1) "0"
}
[2]=>
object(stdClass)#20 (18) {
["id"]=>
string(4) "2077"
["created_at"]=>
string(10) "1470080793"
["updated_at"]=>
string(10) "1472474523"
["status"]=>
string(1) "1"
["sort"]=>
string(1) "0"
["name"]=>
string(27) "Офисная мебель"
["alias"]=>
string(14) "ofisnaja-mebel"
["ikea_alias"]=>
string(10) "workspaces"
["parent_id"]=>
string(1) "0"
["image"]=>
string(36) "6884cb6cf5defdf8ec7fe467bad542ca.jpg"
["h1"]=>
NULL
["title"]=>
NULL
["keywords"]=>
NULL
["description"]=>
NULL
["text"]=>
NULL
["views"]=>
string(3) "247"
["course"]=>
string(4) "9.50"
["discount_percent"]=>
string(1) "0"
}
[3]=>
object(stdClass)#21 (18) {
["id"]=>
string(4) "2078"
["created_at"]=>
string(10) "1470080793"
["updated_at"]=>
string(10) "1472409476"
["status"]=>
string(1) "1"
["sort"]=>
string(1) "0"
["name"]=>
string(34) "Посуда для готовки"
["alias"]=>
string(19) "posuda-dlja-gotovki"
["ikea_alias"]=>
string(7) "cooking"
["parent_id"]=>
string(1) "0"
["image"]=>
string(36) "ca3e4a8eb9d0d7ea22f9a7fc3c300ef9.jpg"
["h1"]=>
NULL
["title"]=>
NULL
["keywords"]=>
NULL
["description"]=>
NULL
["text"]=>
NULL
["views"]=>
string(3) "514"
["course"]=>
string(4) "9.50"
["discount_percent"]=>
string(1) "0"
}
[4]=>
object(stdClass)#22 (18) {
["id"]=>
string(4) "2079"
["created_at"]=>
string(10) "1470080793"
["updated_at"]=>
string(10) "1472547042"
["status"]=>
string(1) "1"
["sort"]=>
string(1) "0"
["name"]=>
string(16) "Столовая"
["alias"]=>
string(9) "stolovaja"
["ikea_alias"]=>
string(6) "dining"
["parent_id"]=>
string(1) "0"
["image"]=>
string(36) "d5704ec3e70a3415b181c7c4f9005c1a.jpg"
["h1"]=>
NULL
["title"]=>
NULL
["keywords"]=>
NULL
["description"]=>
NULL
["text"]=>
NULL
["views"]=>
string(3) "147"
["course"]=>
string(4) "9.50"
["discount_percent"]=>
string(1) "0"
}
[5]=>
object(stdClass)#23 (18) {
["id"]=>
string(4) "2080"
["created_at"]=>
string(10) "1470080793"
["updated_at"]=>
string(10) "1472547236"
["status"]=>
string(1) "1"
["sort"]=>
string(1) "0"
["name"]=>
string(31) "Сервировка стола"
["alias"]=>
string(16) "servirovka-stola"
["ikea_alias"]=>
string(6) "eating"
["parent_id"]=>
string(1) "0"
["image"]=>
string(36) "2d2142a8edd5fc3ce1ffa01fbe6655c9.jpg"
["h1"]=>
NULL
["title"]=>
NULL
["keywords"]=>
NULL
["description"]=>
NULL
["text"]=>
NULL
["views"]=>
string(3) "338"
["course"]=>
string(4) "9.50"
["discount_percent"]=>
string(1) "0"
}
[6]=>
object(stdClass)#24 (18) {
["id"]=>
string(4) "2081"
["created_at"]=>
string(10) "1470080793"
["updated_at"]=>
string(10) "1472540142"
["status"]=>
string(1) "1"
["sort"]=>
string(1) "0"
["name"]=>
string(21) "Кухни МЕТОД"
["alias"]=>
string(11) "kuhni-metod"
["ikea_alias"]=>
string(7) "kitchen"
["parent_id"]=>
string(1) "0"
["image"]=>
string(36) "decf1d321c63aed673d949b34c452a37.jpg"
["h1"]=>
NULL
["title"]=>
NULL
["keywords"]=>
NULL
["description"]=>
NULL
["text"]=>
NULL
["views"]=>
string(3) "304"
["course"]=>
string(4) "9.50"
["discount_percent"]=>
string(1) "0"
}
[7]=>
object(stdClass)#25 (18) {
["id"]=>
string(4) "2082"
["created_at"]=>
string(10) "1470080793"
["updated_at"]=>
string(10) "1472466401"
["status"]=>
string(1) "1"
["sort"]=>
string(1) "0"
["name"]=>
string(18) "Освещение"
["alias"]=>
string(11) "osveschenie"
["ikea_alias"]=>
string(8) "lighting"
["parent_id"]=>
string(1) "0"
["image"]=>
string(36) "3ac3d00a4734040cf346f2a63a09a7f9.jpg"
["h1"]=>
NULL
["title"]=>
NULL
["keywords"]=>
NULL
["description"]=>
NULL
["text"]=>
NULL
["views"]=>
string(3) "243"
["course"]=>
string(4) "9.50"
["discount_percent"]=>
string(1) "0"
}
[8]=>
object(stdClass)#26 (18) {
["id"]=>
string(4) "2083"
["created_at"]=>
string(10) "1470080793"
["updated_at"]=>
string(10) "1472547518"
["status"]=>
string(1) "1"
["sort"]=>
string(1) "0"
["name"]=>
string(14) "Детская"
["alias"]=>
string(8) "detskaja"
["ikea_alias"]=>
string(14) "childrens_ikea"
["parent_id"]=>
string(1) "0"
["image"]=>
string(36) "8d78781b99b8ee7a1abc0f9cbfdc7e01.jpg"
["h1"]=>
NULL
["title"]=>
NULL
["keywords"]=>
NULL
["description"]=>
NULL
["text"]=>
NULL
["views"]=>
string(3) "321"
["course"]=>
string(4) "9.50"
["discount_percent"]=>
string(1) "0"
}
[9]=>
object(stdClass)#27 (18) {
["id"]=>
string(4) "2084"
["created_at"]=>
string(10) "1470080793"
["updated_at"]=>
string(10) "1472411322"
["status"]=>
string(1) "1"
["sort"]=>
string(1) "0"
["name"]=>
string(16) "Гостиная"
["alias"]=>
string(9) "gostinaja"
["ikea_alias"]=>
string(11) "living_room"
["parent_id"]=>
string(1) "0"
["image"]=>
string(36) "c9c933ae12652bca96eb2ef66c832a82.jpg"
["h1"]=>
NULL
["title"]=>
NULL
["keywords"]=>
NULL
["description"]=>
NULL
["text"]=>
NULL
["views"]=>
string(3) "181"
["course"]=>
string(4) "9.50"
["discount_percent"]=>
string(1) "0"
}
[10]=>
object(stdClass)#28 (18) {
["id"]=>
string(4) "2085"
["created_at"]=>
string(10) "1470080793"
["updated_at"]=>
string(10) "1472388754"
["status"]=>
string(1) "1"
["sort"]=>
string(1) "0"
["name"]=>
string(35) "Домашняя прачечная"
["alias"]=>
string(24) "domashnjaja-prachechnaja"
["ikea_alias"]=>
string(7) "laundry"
["parent_id"]=>
string(1) "0"
["image"]=>
string(36) "08c9713d828235679b861c095784af0e.jpg"
["h1"]=>
NULL
["title"]=>
NULL
["keywords"]=>
NULL
["description"]=>
NULL
["text"]=>
NULL
["views"]=>
string(3) "106"
["course"]=>
string(4) "9.50"
["discount_percent"]=>
string(1) "0"
}
[11]=>
object(stdClass)#29 (18) {
["id"]=>
string(4) "2086"
["created_at"]=>
string(10) "1470080793"
["updated_at"]=>
string(10) "1472481068"
["status"]=>
string(1) "1"
["sort"]=>
string(1) "0"
["name"]=>
string(45) "Дополнительное хранение"
["alias"]=>
string(22) "dopolnitelnoe-hranenie"
["ikea_alias"]=>
string(17) "secondary_storage"
["parent_id"]=>
string(1) "0"
["image"]=>
string(36) "bb180b85cc1e34ab9b6185f4cf71fbf0.jpg"
["h1"]=>
NULL
["title"]=>
NULL
["keywords"]=>
NULL
["description"]=>
NULL
["text"]=>
NULL
["views"]=>
string(3) "158"
["course"]=>
string(4) "9.50"
["discount_percent"]=>
string(1) "0"
}
[12]=>
object(stdClass)#31 (18) {
["id"]=>
string(4) "2088"
["created_at"]=>
string(10) "1470080793"
["updated_at"]=>
string(10) "1472136224"
["status"]=>
string(1) "1"
["sort"]=>
string(1) "0"
["name"]=>
string(16) "Прихожая"
["alias"]=>
string(10) "prihozhaja"
["ikea_alias"]=>
string(7) "hallway"
["parent_id"]=>
string(1) "0"
["image"]=>
string(36) "985600d075b4080f57488b87e0e898ff.jpg"
["h1"]=>
NULL
["title"]=>
NULL
["keywords"]=>
NULL
["description"]=>
NULL
["text"]=>
NULL
["views"]=>
string(2) "64"
["course"]=>
string(4) "9.50"
["discount_percent"]=>
string(1) "0"
}
[13]=>
object(stdClass)#32 (18) {
["id"]=>
string(4) "2089"
["created_at"]=>
string(10) "1470080793"
["updated_at"]=>
string(10) "1472556911"
["status"]=>
string(1) "1"
["sort"]=>
string(1) "0"
["name"]=>
string(14) "Спальня"
["alias"]=>
string(7) "spalnja"
["ikea_alias"]=>
string(7) "bedroom"
["parent_id"]=>
string(1) "0"
["image"]=>
string(36) "439a1f90391568bffabcfbc5a8b22559.jpg"
["h1"]=>
NULL
["title"]=>
NULL
["keywords"]=>
NULL
["description"]=>
NULL
["text"]=>
NULL
["views"]=>
string(3) "172"
["course"]=>
string(4) "9.50"
["discount_percent"]=>
string(1) "0"
}
[14]=>
object(stdClass)#33 (18) {
["id"]=>
string(4) "2090"
["created_at"]=>
string(10) "1470080793"
["updated_at"]=>
string(10) "1472481070"
["status"]=>
string(1) "1"
["sort"]=>
string(1) "0"
["name"]=>
string(18) "Еда в ИКЕА"
["alias"]=>
string(10) "eda-v-ikea"
["ikea_alias"]=>
string(4) "food"
["parent_id"]=>
string(1) "0"
["image"]=>
string(36) "1886868c925ed2f22a10fe7e51a6050c.JPG"
["h1"]=>
NULL
["title"]=>
NULL
["keywords"]=>
NULL
["description"]=>
NULL
["text"]=>
NULL
["views"]=>
string(2) "24"
["course"]=>
string(4) "9.50"
["discount_percent"]=>
string(1) "0"
}
[15]=>
object(stdClass)#34 (18) {
["id"]=>
string(4) "2091"
["created_at"]=>
string(10) "1470080793"
["updated_at"]=>
string(10) "1472554267"
["status"]=>
string(1) "1"
["sort"]=>
string(1) "0"
["name"]=>
string(16) "Текстиль"
["alias"]=>
string(7) "tekstil"
["ikea_alias"]=>
string(8) "Textiles"
["parent_id"]=>
string(1) "0"
["image"]=>
string(36) "1ed5b13bc1abab2d5966b6ab074b7174.jpg"
["h1"]=>
NULL
["title"]=>
NULL
["keywords"]=>
NULL
["description"]=>
NULL
["text"]=>
NULL
["views"]=>
string(3) "194"
["course"]=>
string(4) "9.50"
["discount_percent"]=>
string(1) "0"
}
[16]=>
object(stdClass)#35 (18) {
["id"]=>
string(4) "2092"
["created_at"]=>
string(10) "1470080793"
["updated_at"]=>
string(10) "1473774214"
["status"]=>
string(1) "1"
["sort"]=>
string(1) "0"
["name"]=>
string(33) "Домашние растения"
["alias"]=>
string(19) "domashnie-rastenija"
["ikea_alias"]=>
string(16) "indoor_gardening"
["parent_id"]=>
string(1) "0"
["image"]=>
string(36) "a42bf2728494d635bc16b0f12db5855d.jpg"
["h1"]=>
NULL
["title"]=>
NULL
["keywords"]=>
NULL
["description"]=>
NULL
["text"]=>
string(0) ""
["views"]=>
string(2) "55"
["course"]=>
string(4) "9.50"
["discount_percent"]=>
string(1) "0"
}
[17]=>
object(stdClass)#36 (18) {
["id"]=>
string(4) "2093"
["created_at"]=>
string(10) "1470080793"
["updated_at"]=>
string(10) "1472481066"
["status"]=>
string(1) "1"
["sort"]=>
string(1) "0"
["name"]=>
string(39) "Беспроводная зарядка"
["alias"]=>
string(22) "besprovodnaja-zarjadka"
["ikea_alias"]=>
string(17) "wireless_charging"
["parent_id"]=>
string(1) "0"
["image"]=>
string(36) "6ee6de2d3769d7f617b7e05fd81fbaa4.jpg"
["h1"]=>
NULL
["title"]=>
NULL
["keywords"]=>
NULL
["description"]=>
NULL
["text"]=>
NULL
["views"]=>
string(2) "95"
["course"]=>
string(4) "9.50"
["discount_percent"]=>
string(1) "0"
}
[18]=>
object(stdClass)#37 (18) {
["id"]=>
string(4) "2094"
["created_at"]=>
string(10) "1470080793"
["updated_at"]=>
string(10) "1472517463"
["status"]=>
string(1) "1"
["sort"]=>
string(1) "0"
["name"]=>
string(12) "Ванная"
["alias"]=>
string(7) "vannaja"
["ikea_alias"]=>
string(8) "bathroom"
["parent_id"]=>
string(1) "0"
["image"]=>
string(36) "f69159cedca764bc7d44ff7d6a13b52a.jpg"
["h1"]=>
NULL
["title"]=>
NULL
["keywords"]=>
NULL
["description"]=>
NULL
["text"]=>
NULL
["views"]=>
string(3) "157"
["course"]=>
string(4) "9.50"
["discount_percent"]=>
string(1) "0"
}
[19]=>
object(stdClass)#38 (18) {
["id"]=>
string(4) "2095"
["created_at"]=>
string(10) "1470080793"
["updated_at"]=>
string(10) "1472379447"
["status"]=>
string(1) "1"
["sort"]=>
string(1) "0"
["name"]=>
string(24) "Товары IKEA FAMILY"
["alias"]=>
string(18) "tovary-ikea-family"
["ikea_alias"]=>
string(20) "ikea_family_products"
["parent_id"]=>
string(1) "0"
["image"]=>
string(36) "9e0c8d67fd4189ebed7b821e1c6b9df8.jpg"
["h1"]=>
NULL
["title"]=>
NULL
["keywords"]=>
NULL
["description"]=>
NULL
["text"]=>
NULL
["views"]=>
string(2) "78"
["course"]=>
string(4) "9.50"
["discount_percent"]=>
string(1) "0"
}
[20]=>
object(stdClass)#39 (18) {
["id"]=>
string(4) "2096"
["created_at"]=>
string(10) "1470080793"
["updated_at"]=>
string(10) "1472482584"
["status"]=>
string(1) "1"
["sort"]=>
string(1) "0"
["name"]=>
string(34) "Для вашего бизнеса"
["alias"]=>
string(20) "dlja-vashego-biznesa"
["ikea_alias"]=>
string(8) "business"
["parent_id"]=>
string(1) "0"
["image"]=>
string(36) "3b9d8f1d77703f38d3d043fb95dd2b5e.jpg"
["h1"]=>
NULL
["title"]=>
NULL
["keywords"]=>
NULL
["description"]=>
NULL
["text"]=>
NULL
["views"]=>
string(3) "118"
["course"]=>
string(4) "9.50"
["discount_percent"]=>
string(1) "0"
}
}
that is not a code issue. set memory_limit in php.ini file to more than 128m,
you should also increase post meta data to something like 10000
Problem solved with this function:
public static function BuildTree($pid) {
global $MainMenu;
$row = DB::select()
->from('catalog_tree')
->where('parent_id', '=', $pid)
->and_where('status', '=', '1')
->union(DB::select()
->from('catalog_tree')
->where('id', 'in', DB::expr("(SELECT catalog_tree_id FROM catalog_tree_parents WHERE parent_id = '".$pid."')"))
->and_where('status', '=', '1'))
->find_all();
if ($row->count() > 0) {
$MainMenu .= "<ul class=\"dropdown-menu\" role=\"menu\">";
foreach ($row as $value)
{
$MainMenu .= '
<li class="divider"></li>
<li class="dropdown">
<a href="/catalog/' . $value->alias . '">
'. $value->name .'
</a> ';
Widgets::BuildTree($value->id);
}
if ($pid=='0') {
$MainMenu .= " <li class=\"divider\"></li></ul>";
return $MainMenu;
}
else {
$MainMenu .= " <li class=\"divider\"></li></ul></li>";
}
}
}
This function works perfectly :)
I think #DoktorOSwaldo was right, previous recursion was endless.
I'm using array_chunk function:
<?php
$chunks = array_chunk($coupons, 2,true);
?>
#foreach($chunks as $k => $c )
#if(2 == sizeof($c))
$c[0]['tr']->coupon_code
but the blow code not works fine :
$c[0]['tr']->coupon_code
or
$c[0]['tr']['coupon_code']
the content of var_dump($c):
array(2) { [217517]=> array(3) { ["tr"]=> object(stdClass)#71 (30) { ["id"]=> string(6) "217517" ["price"]=> string(5) "14400" ["date"]=> string(19) "2016-01-16 11:13:13" ["user_id"]=> string(5) "16433" ["ip"]=> string(14) "46.225.196.181" ["code"]=> string(13) "5699f4917b9c3" ["succ"]=> string(1) "1" ["admin_seen"]=> string(1) "0" ["user_seen"]=> string(1) "0" ["coupon_id"]=> string(5) "15373" ["coupon_parent"]=> string(5) "15315" ["coupon_code"]=> string(20) "24_1117C1_4644(1453)" ["coupon_code_user"]=> string(4) "1453" ["coupon_code_partner"]=> string(14) "24_1117C1_4644" ["shop_id"]=> string(4) "1117" ["payment_type"]=> string(1) "7" ["merchent_type"]=> string(1) "3" ["merchent_id"]=> string(1) "0" ["cradit_start_date"]=> string(19) "2015-12-29 05:05:05" ["cradit_end_date"]=> string(19) "2016-02-19 05:05:05" ["expired"]=> string(1) "0" ["pay_data"]=> NULL ["seri"]=> string(1) "C" ["to_friend"]=> string(1) "0" ["finance_id"]=> string(1) "0" ["app"]=> string(3) "web" ["expire_date"]=> string(19) "0000-00-00 00:00:00" ["expire_app"]=> string(0) "" ["buy_id"]=> string(13) "5699f4913103e" ["coupon_property_id"]=> string(3) "195" } ["offer"]=> object(stdClass)#67 (46) { ["id"]=> string(5) "15373" ["title"]=> string(21) "طرح دخترانه" ["slider_title"]=> string(0) "" ["short_title"]=> string(0) "" ["pic"]=> string(25) "Bracelets-off-Greek31.jpg" ["text"]=> string(0) "" ["attrs"]=> string(0) "" ["jest"]=> string(0) "" ["terms_of_use"]=> string(0) "" ["how_to_use"]=> string(0) "" ["city"]=> string(0) "" ["price"]=> string(5) "45000" ["off"]=> string(2) "68" ["min_users"]=> string(1) "0" ["max_users"]=> string(1) "0" ["current_users"]=> string(1) "2" ["expire"]=> string(1) "0" ["sell_start_date"]=> string(19) "2015-12-29 01:00:00" ["sell_end_date"]=> string(19) "2016-01-26 15:00:00" ["cradit_start_date"]=> string(19) "0000-00-00 00:00:00" ["cradit_end_date"]=> string(19) "0000-00-00 00:00:00" ["admin_expire_date"]=> string(19) "0000-00-00 00:00:00" ["showin_other"]=> string(1) "0" ["showin_slider"]=> string(1) "0" ["showin_slider_cat"]=> string(1) "0" ["moment"]=> string(1) "0" ["seri"]=> string(1) "C" ["shop_id"]=> string(4) "1117" ["tractions"]=> string(1) "0" ["status"]=> string(1) "0" ["url"]=> string(0) "" ["shadyab_profit"]=> string(4) "6400" ["fake_sell"]=> string(1) "3" ["confirm"]=> string(1) "0" ["adviser"]=> string(1) "0" ["parent"]=> string(5) "15315" ["description"]=> string(0) "" ["old"]=> string(1) "0" ["email_text"]=> string(0) "" ["zone"]=> string(0) "" ["views"]=> string(1) "0" ["max_buy"]=> string(1) "0" ["likes"]=> string(1) "0" ["alt"]=> string(70) "فروشگاه گیوا گالری, خرید اینترنتی کالا" ["sizes"]=> string(0) "" ["name"]=> string(11) "مدل ها" } ["details"]=> object(stdClass)#66 (22) { ["id"]=> string(6) "205585" ["tr_id"]=> string(6) "217517" ["title"]=> string(59) "دستبند چرم پلاک استیل طرح فانتزی" ["short_title"]=> string(0) "" ["pic"]=> string(17) "dastband_(2)1.jpg" ["text"]=> string(627) "
Problem here is that you preserve keys form original array. So, you don't have 0 or 1 key in a chunk $c.
Either you do not preserve keys $chunks = array_chunk($coupons, 2) as you have id in a tr object within id property and use $c[0]['tr']->coupon_code
Or you should get keys of a chunk $c with array_keys for example:
foreach($chunks as $k => $c) {
$keys = array_keys($c);
echo $c[$keys[0]]['tr']->coupon_code;
}
$c[0]['tr']['coupon_code'] is an object of type object(stdClass) .
I suppose you use json_decode before the array_chunk.
If you use json_decode($yourjson), you have to use json_decode($yourjson, true); to convert the json into array instead of stdClass.
EDIT:
Check too the keys of $c with vardump(array_keys($c)). I'm not sure $c[0] is defined.
I thought to access the value of '1' here, I would need to the following
$data['category'][0];
["category"]=> array(1) { [0]=> string(1) "1" }
But it doesn't return anything. How would I access the string(1) section to get the value 1?
Here is the full var dump of the variable $data array
array(18) { ["RET"]=> string(65) "/account/add-submission" ["URI"]=> string(22) "account/add-submission" ["XID"]=> string(40) "3ee1766dfdbe4684831021c99a9197beaede03be" ["return_url"]=> string(36) "account/submission-complete/ENTRY_ID" ["channel_id"]=> string(1) "4" ["entry_id"]=> string(1) "0" ["ACT"]=> string(1) "4" ["meta"]=> string(556) "pdKeUQVJTA6FeLnmeqtK0gGu2C1S2gKOvRrMDjjKMou7JAp2HVA48Gn+yXTjY4tKuBam5rlyszhe3rEF2eClOB5bRPEJ8NYeh/qPBSkDuhuk0j+XYrQ0R7dJhaHZPIr1b5sge8/kqmWj2qvrpO5pE/iC6X4scIO2HmOPjWb4Sea2VgGwgQ70j7Qr1QmHlQAIZ95DXMp3YkietUWLWaFKvr8XwSx+vUhKEaueVoAbP0Le3fu0rMqz2LuZIScGpwn4yPJbenkc0P5ME/nM9CsfnzYPmM1cwTHO1Xe/wtJ3HGbNcglfn+A9ubz1GBNULgUvxYAW6eFrhqfAJ2omfiwSzpQkISJaDZvZofjOCHjiS7VaUIDgWOrznOm7oWR3m5Ut4TOxmsX2jeKpUAvLJQppc1+1hormnRSA0mambV0uodflDaZEZbPKmjWxsZD3doNJzmIG29bQtBV+UWdQ4xkxyM6fhyMmUkKGAgE+Xegkp/zK7+AXc4s8bEBENPAa1UbCkh0XEq4IYIqWRzYL/T2bfyySCPzvrbFBErIwj3jUF+w=" ["return"]=> string(36) "account/submission-complete/ENTRY_ID" ["site_id"]=> string(1) "1" ["submission_file_hidden_file"]=> string(0) "" ["submission_file_hidden_dir"]=> string(1) "1" ["type"]=> string(3) "1.1" ["snap_FxlgTgCET"]=> string(13) "vyHdSjitmEUoV" ["submission_file"]=> string(37) "{filedir_1}Tharp_BIO_Pic300x20038.jpg" ["field_id_48"]=> string(37) "{filedir_1}Tharp_BIO_Pic300x20038.jpg" ["field_ft_48"]=> string(4) "none" ["revision_post"]=> array(26) { ["RET"]=> string(65) "/account/add-submission" ["URI"]=> string(22) "account/add-submission" ["XID"]=> string(40) "3ee1766dfdbe4684831021c99a9197beaede03be" ["return_url"]=> string(36) "account/submission-complete/ENTRY_ID" ["author_id"]=> string(1) "1" ["channel_id"]=> string(1) "4" ["entry_id"]=> string(1) "0" ["ACT"]=> string(1) "4" ["meta"]=> string(556) "pdKeUQVJTA6FeLnmeqtK0gGu2C1S2gKOvRrMDjjKMou7JAp2HVA48Gn+yXTjY4tKuBam5rlyszhe3rEF2eClOB5bRPEJ8NYeh/qPBSkDuhuk0j+XYrQ0R7dJhaHZPIr1b5sge8/kqmWj2qvrpO5pE/iC6X4scIO2HmOPjWb4Sea2VgGwgQ70j7Qr1QmHlQAIZ95DXMp3YkietUWLWaFKvr8XwSx+vUhKEaueVoAbP0Le3fu0rMqz2LuZIScGpwn4yPJbenkc0P5ME/nM9CsfnzYPmM1cwTHO1Xe/wtJ3HGbNcglfn+A9ubz1GBNULgUvxYAW6eFrhqfAJ2omfiwSzpQkISJaDZvZofjOCHjiS7VaUIDgWOrznOm7oWR3m5Ut4TOxmsX2jeKpUAvLJQppc1+1hormnRSA0mambV0uodflDaZEZbPKmjWxsZD3doNJzmIG29bQtBV+UWdQ4xkxyM6fhyMmUkKGAgE+Xegkp/zK7+AXc4s8bEBENPAa1UbCkh0XEq4IYIqWRzYL/T2bfyySCPzvrbFBErIwj3jUF+w=" ["return"]=> string(36) "account/submission-complete/ENTRY_ID" ["site_id"]=> string(1) "1" ["title"]=> string(3) "asd" ["submission_file_hidden_file"]=> string(0) "" ["submission_file_hidden_dir"]=> string(1) "1" ["type"]=> string(3) "1.1" ["category"]=> array(1) { [0]=> string(1) "1" } ["snap_FxlgTgCET"]=> string(13) "vyHdSjitmEUoV" ["submission_file"]=> string(24) "Tharp_BIO_Pic300x200.jpg" ["field_id_48_hidden_file"]=> string(0) "" ["field_id_48_hidden_dir"]=> string(1) "1" ["field_id_48"]=> string(24) "Tharp_BIO_Pic300x200.jpg" ["field_ft_48"]=> string(4) "none" ["allow_comments"]=> string(1) "y" ["entry_date"]=> string(10) "1380114180" ["status"]=> string(4) "open" ["previous_status"]=> bool(false) } }
To access that data you have to use $data['revision_post']['category'][0] because category array is in revision_post array.
The value of $data['category'][0] is an array. So you would access like this:
$data['category'][0] = array('1');
echo $data['category'][0][0];
Try it for yourself by copying and pasting here http://writecodeonline.com/php/