[Solved] Calculate the distance between 2 position Google maps Api

[ad_1] My code is get distance of 2 point or 2 location in map with google map deriction service var PolylineOption = { strokeColor : “blue”, strokeOpacity : 0.5, strokeWeight : 5 }; var request = { origin : polyline[0].start, // điểm đầu waypoints : polyline[1].waypoint, destination : polyline[2].end, // Điểm cuối optimizeWaypoints : true, … Read more

[Solved] How to get this city from .txt and add this to database using PHP? [closed]

[ad_1] Its pretty easy. You need to google to read file in PHP and write to database in PHP. Here I’ll start you off: $file_handle = fopen(“cit.txt”, “rb”); while (!feof($file_handle) ) { $line_of_text = fgets($file_handle); // write your insert statement here, depending on your table structure. } [ad_2] solved How to get this city from … Read more

[Solved] PHP – How to format data for in_array

[ad_1] Use FIND_IN_SET() to search for an element of a comma-separated list. $lsc_adminid_query = xtDBquery(” SELECT lsc.option_id FROM lsc_config lsc WHERE FIND_IN_SET({$_SESSION[‘customer_id’]}, lsc.option_value)”); But it would be better to normalize your design so you don’t have comma-separated lists in database columns in the first place. 3 [ad_2] solved PHP – How to format data for … Read more

[Solved] Calling PHP Functions [closed]

[ad_1] Try this in your php code :- $return_array = getMovieCategories($your_movie_id); it wil call a function getMovieCategories($movie_id) and the result will be stored in $return_array For more info please check this link – Function Call [ad_2] solved Calling PHP Functions [closed]

[Solved] and

[ad_1] Please show more about your problem detail like paste your error code in here that we could use those information to help you. Btw, base_url() isn’t a php embedded function, one of the potential problem is that your friend custom a function named base_url() that supposed to return it’s root path. So, you have … Read more

[Solved] PHP Date issues [duplicate]

[ad_1] Here is a simple function to do that //birthday YYYY-MM-DD function userInfo($fname, $lname, $birthday) { //Calc age $age = date_diff(date_create($birthday), date_create(‘today’))->y; return $fname .” “. $lname . ” “.$age; } now call it echo userInfo(‘John’, ‘Doe’, ‘1986-02-01’); 1 [ad_2] solved PHP Date issues [duplicate]

[Solved] How can I do an implode on certain fields of a two-dimensional array? [closed]

[ad_1] PHP 5.5: $result = join(‘,’, array_column($data, ‘user_id’)); 5.3<=PHP<=5.4: $result = join(‘,’, array_map(function($item) { return $item[‘user_id’]; }, $data)); PHP<5.3: $result = join(‘,’, array_map(create_function(‘$item’, ‘return $item[“user_id”];’))); [ad_2] solved How can I do an implode on certain fields of a two-dimensional array? [closed]

[Solved] Trying to make this entire line of code into a hyperlink [closed]

[ad_1] This: echo “<a href=”https://stackoverflow.com/questions/43282015/test.php”>CategoryID: {$row[‘CategoryID’]} – Category Name: {$row[‘CategoryName’]}</a><br />”; I am using the { and } as they allow you to include an array in a string and ignore the concatenation which I find harder to read. I find it funny that you can loop through a MySQL array but can’t echo a … Read more

[Solved] Pass Javascript var into PHP var

[ad_1] You cannot do that. PHP is executed on your server. Javascript on the otherhand is executed on your client’s machine in the browser. There are two different execution context. While you can pass a PHP variable into Javascript, you cannot do the opposite since PHP is executed first and the JavaScript code is the … Read more

[Solved] how to convert array to ArrayObject with php from json file

[ad_1] To read the data $unsortedData = json_decode(file_get_contents(“data.json”), true); the second paramater true make you get an associative array, instead of getting an array of objects (stdclass) to sort the array: usort($unsortedData, function($a, $b){ return $a[‘serial’] < $b[‘serial’]; }); usort will sort the data according the callback passed as the second parameter, so you can … Read more