[Solved] Regex to find substring inside an html attribute [duplicate]

My warning in the comments section being said, you could use a combination of preg_replace_callback() and str_replace(): $str=”<input data-content=”This is a text string with a <br /> inside of it” />”; $regex = ‘/data-content=”([^”]*)/i’; $str = preg_replace_callback($regex, function($matches) { return str_replace(array(‘<br/>’, ‘<br />’), ”, $matches[0]); }, $str); echo $str; // output: <input data-content=”This is a … Read more

[Solved] Unexpected set_value [duplicate]

There are missing dots, change it like in your form_error: echo ‘<div class=”form-group has-error”> <label class=”control-label” for=”inputError”>School ID:</label> <input type=”text” class=”form-control” name=”inputSchoolID” id=”inputError” value=”‘ . set_value(‘inputSchoolID’) . ‘;”> <span class=”help-block”>’. form_error(‘inputSchoolID’) .'</span> </div>’; 1 solved Unexpected set_value [duplicate]

[Solved] Regular Expression for nickname [closed]

This is something to get you started, but you’ll need to tweak it and adapt it to what you need: [a-zA-Z]\w{5,14} ^ ^ | match an alphanumeric or underscore character 5 to 14 times | match a single alphabetic character 6 solved Regular Expression for nickname [closed]

[Solved] Space not working in my form? [closed]

I think I found the problem but not sure if it is yours. If you disable JavaScript, then you can add spaces so definitely a .js file causing this issue! You have so many JavaScript files all the time that makes it very difficult to track a specific problem but in your jquery.galleriffic.min.js there are … Read more

[Solved] Only last element of array is displayed [closed]

You are overwriting the value of $tweetfeed in every itteration. $tweetfeed = array ( ‘status’ => $status ); Should be: $tweetfeed[] = array ( ‘status’ => $status ); By using [] you are pushing the value into the array, rather than overwriting it. You could actually simplify the whole thing to: $tweetfeed = array(); foreach($users … Read more

[Solved] looping thru multidimentional array and getting value of keys [closed]

//Initiate new array to store coords $latlongs = array(); //Loop through your array foreach($yourArray as $k=>$v){ // Loop through the partnerlist to extract lat/lon // Append to your coord array, and preserve the industry key // So that you know which lat/lons came from where foreach($v[‘partnerlist’] as $a){ $latlongs[$k][] = array(“latitude”=>$a[‘latitude’],”longitude”=>$a[‘longitude’]; } } This will … Read more

[Solved] How to fix Undefined Index warnings? [duplicate]

You could check with isset like if (isset($_GET[‘errormsg’]) && $_GET[‘errormsg’] == ‘no_appid’) { $_SESSION[‘errormsg’] = “There was a problem with your application. Please reenter all data.”; } look at php isset 4 solved How to fix Undefined Index warnings? [duplicate]

[Solved] Sendmail as HTML output [closed]

Add Content-type:text/html;charset=UTF-8 to you header and remove * from html tags like this $headers = “MIME-Version: 1.0” . “\r\n”; $headers .= “Content-type:text/html;charset=UTF-8” . “\r\n”; $headers .= “From: <****@example.com>’ . “\r\n”; $headers .= “Cc: ****@example.com’ . “\r\n”; $message =” <html> <head> <title>HTML email</title> </head> <body> <div>Hello ” . $row[‘first_name’] . ” ” . $row[‘last_name’] . “</div> … Read more

[Solved] how print false if column value is 0 or less than 0 or null,print true if value is greater than 0 [closed]

assuming that your values are integers you can just do this way: if($info[‘EmailCount’] && $info[‘SMSCount’] && $info[‘EmailCount’] >= 0 && $info[‘SMSCount’] >= 0){ echo “true”; }else{ echo “false”; } 7 solved how print false if column value is 0 or less than 0 or null,print true if value is greater than 0 [closed]

[Solved] PHP and Mysql Permission system [closed]

Try to use this: if ($accounttype == ‘a’) { print ‘Member’; } elseif ($accounttype == ‘b’) { print ‘Moderator’; } elseif ($accounttype == ‘c’) { print ‘Admin’; } else { print ‘No rank’; } You need use strings in a quotes, and don’t forget semicolons ; at the end of line 3 solved PHP and … Read more