Category : function

I make this associative array with PHP. $colors = [‘a’ => ‘red’, ‘b’ => ‘green’, ‘c’ => ‘blue’, ‘d’ => ‘yellow’, ‘e’ => ‘pink’]; Now by using array_rand() function => $newArray = array_rand($colors, 2); The Output is: [0] => a [1] => b This output shows me only the key of the array. But I ..

Read more

this fetch_data.php file fetch data for viewpost.php to load comments but I am not able to filter it by post it .. meanwhile when I write code $query ="SELECT * FROM tbl_comment WHERE parent_comment_id = ‘0’ and post_id = $row[‘id’] ORDER BY comment_id DESC"; $statement = $connect->prepare($query); $statement->execute(); $result = $statement->fetchAll(); $output = ”; foreach($result ..

Read more

Please could someone be so kind and help me with an error I’m getting. Before I explain I looked at the similar question but unfortunately it didn’t help. Anyways I tried to increase PHP Maximum memory allocation but the error message just asked me to increase it further no matter the size. Here is the ..

Read more

I am using a custom PHP function I found on SO. The function’s purpose is to find the contents in between to tags and the I replace them with str_ireplace. Here is the function: function get_string_between($string, $start, $end){ $string = ‘ ‘ . $string; $ini = stripos($string, $start); if ($ini == 0) return ”; $ini ..

Read more

I cant find why my function doesnt create PNG and GIF thumbs? JPG and JPEG works ok. GD is enabled…and I get no errors in LOG file… Please help. Thank you! function create_thumb($src,$dest,$desired_width = false, $desired_height = false){ /*If no dimenstion for thumbnail given, return false */ if (!$desired_height&&!$desired_width) return false; $fparts = pathinfo($src); $ext ..

Read more