[Solved] Parse error: syntax error, unexpected T_IF, expecting ‘)’ What should I do? [duplicate]

[ad_1] try this, get role value outside array $role = “”; $option = $_GET[‘I-would-like’]; $option = trim($option); if ($option == ‘A quotation’ || $option == ‘Information’) { $role=”customer”; } else if($option == ‘To become a Partner’) { $role=”partners”; } else if ($option == ‘Training / Coaching’) { $role=”students”; } $userdata = array( ‘user_login’ => $username, … Read more

[Solved] How to add text in option using jquery? [closed]

[ad_1] Try this code: HTML: <span id=”text1″>Medium Tail</span> JS: you can use empty and append method to do that: $(document).ready(function(){ $(“#text1”).empty().append(“Medium Tail/Popular”); }); Plz check it out: http://jsfiddle.net/o1f77e1y/ 1 [ad_2] solved How to add text in option using jquery? [closed]

[Solved] How to define day is sunday and Normal day. using switch case by date? [closed]

[ad_1] Try it:- function holyday($today) { $start_date = strtotime($today); if(date(‘z’,$start_date) ==0) { return ‘New Year’; }else{ if(date(‘l’,$start_date) ==’Sunday’) { return ‘Sunday’; }else{ return “Noraml Day”; } } } echo holyday(‘2012-09-06’); Output = Noraml Day echo holyday(‘2013-01-01’); Output = New year 7 [ad_2] solved How to define day is sunday and Normal day. using switch case … Read more

[Solved] setTime() replacement in php [closed]

[ad_1] First of all, you need to convert milliseconds to seconds and then use the date() function with the following format: $mili = 1641951202187.3433; $sec = $mili /1000; echo date(‘M-m-Y H:i:s’,$sec); [ad_2] solved setTime() replacement in php [closed]

[Solved] PHP multidimensional array keys combinations/combinatorics [closed]

[ad_1] I made some slight modifications to the original code in order to make it use the amount of keys instead of the array values, and then I added a second function to allow a multi-dimensional array to be counted as well. <?php function everyCombination($array) { $newArray = array(); for($keyCount = 1; $keyCount <= count($array); … Read more

[Solved] PHP Use array map to reOrder an array

[ad_1] You can simply use foreach instead like as foreach($your_arr as &$v){ $v = [$v[“period”] => $v[“way”]]; } print_r($your_arr); Or using array_map $your_arr = array_map(function($v){ return [$v[“period”] => $v[“way”]]; },$your_arr); print_r($your_arr); [ad_2] solved PHP Use array map to reOrder an array

[Solved] Find the Position of a Word in a String? [duplicate]

[ad_1] you could do: function find_word_pos($string, $word) { //case in-sensitive $string = strtolower($string); //make the string lowercase $word = strtolower($word);//make the search string lowercase $exp = explode(” “, $string); if (in_array($word, $exp)) { return array_search($word, $exp) + 1; } return -1; //return -1 if not found } $str = “This is a string”; echo find_word_pos($str, … Read more

[Solved] how to Send & symbol in xml body to server

[ad_1] You can create a category on NSString and then encode few characters that you cant send directly… few are implemented below: @implementation NSString (URLEncoding) – (NSString *) stringByUrlEncoding{ return (NSString *)CFBridgingRelease(CFURLCreateStringByAddingPercentEscapes(NULL, (CFStringRef)self, NULL, (CFStringRef)@”!*'();:@&;=+$,/?%#[]”, kCFStringEncodingUTF8)); } @end [ad_2] solved how to Send & symbol in xml body to server

[Solved] add 1 day to date format YYYYMMDD when field name is greater or equal to 1200 [closed]

[ad_1] With the help of STR_TO_DATE and DATE_FORMAT function you can achieve this: SELECT DATE_FORMAT(STR_TO_DATE(dateUs,’%Y%m%d’) + INTERVAL HourMins+0 >= 1200 DAY ,’%Y%m%d’) AS dateLoc FROM your_table Demonstration: SET @str := ‘20160919’; SET @HOUR := ‘1215’; SELECT ( STR_TO_DATE(@str, ‘%Y%m%d’) + INTERVAL (@HOUR + 0) >= 1200 DAY ) AS date, DATE_FORMAT( STR_TO_DATE(@str, ‘%Y%m%d’) + INTERVAL … Read more