Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

When using a Fetch( )) function to retrieve the data from a url or other source, you can specify and filter results in your Interactions.

...

Basic Madl components used in the formatting or changing of fetched data in Interactions.

 

Table of Contents

$t->trim( )

 This function will find removes white space off start and end of any data found in the fetch results.

...

$t->removeTags( )

 This function will remove all HTML tags s in the fetch results. Common use is for removing <p> <a> tags from fetch results to assist with displaying data in containers.

Parameters   

 
 $allowable_tagsOptional $allowable_tags parameter lets you specify the tags you do not want to remove. 

Return Values   

 
$t->result
Returns page source or structured data / XML into variable $t 
 
Code Block
themeRDark
languagephp
linenumberstrue
$t->fetch("[http://blinkmobile.com.au/mobile-solutions/");]


$t->removeTags ( string $str [, string $allowable_tags ] ) 

return $t->result;
 

 

 
 

$t->replace( )

This function will find and replace any data found in the fetch results. Common use is for replacing results be it text, images or HTML tags to assist with displaying data.

Parameters   

 
 $search
String. Required. Specifies the value to find
$replace
String. Required. Specifies the value to replace the value in find

Return Values   

 
$t->result
Returns page source or structured data / XML into variable $t 
Code Block
themeRDark
languagephp
linenumberstrue
$t->fetch("[http://blinkmobile.com.au/mobile-solutions/");]
$t->replace("For information about things for visitors to see and do in and around Brisbane, visit:","");

return $t->result;

 

 

 

$t->str_replace( )

This function will find and replace any data found in the fetch results. Common use is for replacing results be it text, images or HTML tags to assist with displaying data.

Parameters   

 
 $search
String. Required. Specifies the value to find
$replace
String. Required. Specifies the value to replace the value in find

Return Values   

 
$t->result
Returns page source or structured data / XML into variable $t 
Code Block
themeRDark
languagephp
linenumberstrue
$t->fetch("[http://blinkmobile.com.au/mobile-solutions/");]
$t->str_replace("Experience Brisbane","");

return $t->result;

 

$t->ucwirds( )

 Returns a string with the first character of each word in str capitalised, if that character is alphabetic.

Parameters   

 
 
None

Return Values   

 
$t->result
Returns page source or structured data / XML into variable $t 
Code Block
themeRDark
languagephp
linenumberstrue
$t->fetch("[http://blinkmobile.com.au/mobile-solutions/");]


$t->ucwords();

return $t->result;

 

...

Introduced in the April 2013 release BMP Sand Box of client code.

 

This function will find and replace any data found in the fetch results. Common use is for replacing results be it text, images or HTML tags to assist with displaying data.

Header() is used to send a raw HTTP header. See the » HTTP/1.1 specification for more information on HTTP headers. 

Parameters   

 
 $search $string
A String. Required.containing Specifies the value to find
$replace
String. Required. Specifies the value to replace the value in find

 

 

header string.
$replace

Boolean, The optional replace parameter indicates whether the header should replace a previous similar header,

or add a second header of the same type.By default it will replace,but if you pass in FALSE as the second argument you can force multiple headers of the same type.

$http_response_code

An Integer, or String containing url or page to re-direct to.

$eader_in_output=false

Forces the HTTP response code to the specified value. Note that this parameter only has an effect if the string is not empty.

  

Return Values   

 
$t->result
Returns page source or structured data / XML into variable $t 

 

 

 

...

themeRDark
languagephp
linenumberstrue

...

Currently the setCode() function will automatically replace all header() to $t->header().

From the April 2013 release it is advised to use this mADL function instead.