Assuming array is required, the following 46 results were found.
= preg_replace("/\"(.*?)\"/e", "search_transform_term('\$1')", $terms); $terms = preg_split("/\s+|,/", $terms); $out = array(); foreach($terms as $term){ $term = preg_replace("/\{WHITESPACE-([0-9]+)\}/e", "chr(\$1)", $term); $term =...
item1c,"item2c,c" item1b,item2b What I want: To read the file (stored on the server) and convert to a JavaScript array of objects var my_object_array = [ { my_col1_val: 'item1a', my_col2_val: 'item2a' }, { my_col1_val: 'item1b', my_col2_val: 'item2b' },...
// Create a new query object. $query = $db->getQuery(true); // build the SQL query $query->select($db->quoteName(array('p.user_id', 'u.username', 'u.real_name'))); $query->from($db->quoteName('#__user_profiles p')); $query->join('INNER',...
An article on how to quickly adapt an array code and sort by its values. Surprising how many examples are on the web and everyone saying you're doing it wrong... Which is true but quite unhelpful. The original code is not my own either but that's not an...
{ // get seconds ago $v_Seconds = strtotime('now') - strtotime($p_Date); // set unit labels $a_UnitLabels = array('year','month','week','day','hour','minute','second'); // set unit values $a_UnitValues = array( floor($v_Seconds / 31536000),...
my_date_field FROM my_table WHERE my_id='$this_id'"), 0, "my_date_field"); $this_date_array=explode("-", trim(substr($this_date, 0, strpos($this_date, " ")))); $this_time=trim(substr($this_date, strpos($this_date, " ")+1));...
This is an article documenting how to send a Zoho Deluge Map request to an API which is expecting nested/2d/multi-dimensonal arrays. In the example below, we are posting to a PHP script for testing but I have since sent something similar to an API...
(for sorting purposes - eg. so 10 is not before 2) Store both the formatted count and the value of column1.table in the next array entry Reverse this array Display the first 10 rows of this array (if we are doing a top ten) My new method is: SELECT...
{ try { // Check type for all string properties if (object.ReferenceEquals(p.PropertyType, typeof(string))) { // declare two arrays string[] exceptionArray_this; string[] exceptionArray_that; // get the value we want to transform string ValueToConvert =...
'', $site_structure_string); var $site_structure_item = $_GET['myFiles']; var $site_structure_array = explode('/', $site_structure_string); // yields $site_structure_array[0] = 'blog' $site_structure_array[1] = 'videos' $site_structure_array[2] = '2010'...
curl_setopt($ch1, CURLOPT_RETURNTRANSFER, true); // set authorization header curl_setopt($ch1, CURLOPT_HTTPHEADER, array('Content-Type: '.$mime_type, 'Content-Length: ' . filesize($file), 'Authorization: Bearer ' . $access_token) ); // execute cURL...
// optional m_Data= Map(); m_Data.put("data",m_RecordData.toJSONList()); // NOTE: convert this to a JSON Array r_RecordUpdate = invokeUrl [ url :v_EndPoint type :PUT headers: m_Header parameters:m_Data.toString() ]; // NOTE: convert parameters variable...
subform management // ***************************************** // declare the new row and JSON argument var json_Row = new Array(); var json_Arg = new Object(); // get some values beforehand which allows us to compare to the rows already present in the...
Count By str_ireplace took : 0.39766597747803 Seconds Count By Explode+Count took : 0.25045800209045 Seconds Count By Array Functions took : 1.1077101230621 Seconds Count By preg_split+Count took : 0.30741000175476 Seconds Count By substr_count took :...
with cURL isn't a problem, but I want to convert it to JSON and I usually use a PHP function to load the data into an XML array and use the built-in PHP function: "json_encode". How? So here's what I tried and ended up with: If your XML is UTF-8 This is...
5px 5px 0px rgba(51, 51, 51, 0.3); }"; $v_AppStyleFormatted = preg_replace('/\s+/', ' ', $v_AppStyle); and a few str_replace arrays: // exceptions $a_ReplaceFrom1 = array("px ", "0 ", " a"); $a_ReplaceTo1 = array("px?", "0?", "?a"); $v_AppStyleFormatted...
it's in /* lines */ which means these are comments. The quick solution is: $_REQUEST['tmpl'] = 'component'; $offensive_words=array("viagra","cialis","[url=","porn","pfizer"); if (is_array($_GET)) $GotVars.=implode(",", $_GET).","; if (is_array($_POST))...
section of the code to go through the logic and highlight any changes you may need to make. 1. First: the variables are in arrays Well mostly. Simply because we'll be working with JSON data and this encodes/decodes easily into PHP arrays. I can also...
lot of repetition so lets reduce that a touch: // default $author_name_disp=$author_name; // check and transform $delimiters=array(' ', '.'); foreach($delimiters as $word_index=>$delimiter) { if (strpos($author_name, $delimiter)!==false) {...
is working: My_Date = today; Day_Name = My_Date.toString("EEEE"); // returns "Monday" Method #1: We're going to populate two arrays / lists; retrieve the index value; and use this in the second array as follows: // lists Day_Names =...