Category : if-statement

I want to save the car id and a timestamp to a DB. But only the last 3 viewed cars. id  |  timestamp    |       VehicleId 01 |23-09-21 22:53|XIEKFWSH7S5GESQDGS 02 |23-09-21 24:32|GSTRDDHSDE5GHRDSGD 03 |23-09-21 46:17|LDHGUC86SJNB6%HNSH Check if there is a old timestamp and overwrite would be preferred (if, then else), as it would generate a lot of data. Source: Ask ..

Read more

i am using the following code: if ($this->FileSD->Upload->FileSize > 0) { $rsnew["FileSD"] = "$rname $docpath1 $docpath2 " . " " . "$docpath SD-ID$docid" . ".$ext3"; return TRUE; } else { $rnew["FileSD"] = "$rname $docpath1 $docpath2 " . " " . "$docpath SD-ID$docid" . ".$ext4"; return TRUE; } if ($this->File->Upload->FileSize > 0) { $rsnew["File"] = "$rname ..

Read more

there has to be a better way of doing this if (count($page) == 0) { print_r($array["title"]); } if (count($page) == 1) { print_r($array[$page[0]]["title"]); } if (count($page) == 2) { print_r($array[$page[0]][$page[1]]["title"]); } if (count($page) == 3) { print_r($array[$page[0]][$page[1]][$page[2]]["title"]); } if (count($page) == 4) { print_r($array[$page[0]][$page[1]][$page[2]][$page[3]]["title"]); } if (count($page) == 5) { print_r($array[$page[0]][$page[1]][$page[2]][$page[3]][$page[4]]["title"]); } if (count($page) == ..

Read more

till where i could understand its a problem in variable please help in solving this issue what am i developing? i am making a gui interface to edit a database for my project this code is just php and a bit of html hopefully this problem will be resolved main form: <section class="signup form"> <h2>rigister ..

Read more

I want to filter websites using xml depending on whether the values are contained in it or not. I have such a script and I don’t know why, but it filters well once, not, can anyone advise me something? <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE note SYSTEM "Note.dtd"> <filter> <min_szerokosc>111</min_szerokosc> <min_wysokosc>111</min_wysokosc> <min_glebokosc>111</min_glebokosc> <max_szerokosc>1111</max_szerokosc> <max_wysokosc>1111</max_wysokosc> <max_glebokosc>1111</max_glebokosc> <typ>power&free</typ> <myjnia_automat>1</myjnia_automat> ..

Read more

Code below is great to display ALL the meta of an item in the order – How do I hide certain meta from displaying? eg. display all except if meta key is ‘something’ and ‘somethingelse’ <?php foreach ( $order->get_items() as $item_id => $item ) { $item_meta_data = $order_item_product->get_meta_data(); echo $product_name = $order_item_product->get_name(); echo ‘<br>’; foreach( ..

Read more

I am trying to foreach multiple arrays with if condition, I have 3 arrays like below : $contents = array(‘content1’, ‘content2’, ‘content3’, ‘content4’); $types = array(‘pdf’, ‘pdf’, ‘txt’, ‘pdf’); $links = array(‘link1’, ‘link2’, ‘link3’); foreach ($contents as $key => $value) { echo "$value<br>"; if ($types[$key] == ‘pdf’) { echo "$links[$key]<br>"; } } Output is like ..

Read more