Search Our Site

Our Newsletter

Our Ramblings

A look at some useful PHP functions. isset() vs empty() vs is_null()

Were currently developing a new system in collaboration with our partners at 802 Works – Redefining Wireless. As a part of that, were designing a new system for administering Wireless systems and maximising the marketing leverage that can be gained from them. That job involves having to write quite a lot of PHP pages and scripts. We thought we’d share a short tip on PHP variable declaration.

We’re going to look at the different ways that variables can be empty in this post. PHP has many different operators which can be used to test a variable. Three useful operators used for this are isset(), empty() and is_null(). Each of these operators return a boolean value (either true or false).

Lets take a look at these operators in a little more detail:

isset()

From the bible of PHP, the PHP manual, isset’s job is to “determine if a variable is set and is not NULL”. In other words, it returns true only when the variable is not null.

empty()

Again from the PHP manual, empty’s job is to “determine whether a variable is empty”. In other words, it will return true if the variable is an empty string, false, array(), NULL, “0?, 0, and an unset variable.

is_null()

Finally, from the PHP manual, is_null’s jobis to “find whether a variable is NULL”. In other words, it returns true only when the variable is null.

You may now be thinking that is_null() is opposite of isset() and , broadly speaking you’d be correct however there is one difference and that is that isset() can be applied to unknown variables, but is_null() only to declared variables.

The table below is an easy reference for what these functions will return for different values.

 

Value of variable ($var) isset($var) empty($var) is_null($var)
“” (an empty string) bool(true) bool(true)  bool(false)
” ” (space) bool(true)  bool(false)  bool(false)
FALSE bool(true) bool(true)  bool(false)
TRUE bool(true)  bool(false)  bool(false)
array() (an empty array) bool(true) bool(true)  bool(false)
NULL  bool(false) bool(true) bool(true)
“0” (0 as a string) bool(true) bool(true)  bool(false)
0 (0 as an integer) bool(true) bool(true)  bool(false)
0.0 (0 as a float) bool(true) bool(true)  bool(false)
var $var; (a variable declared, but without a value)  bool(false) bool(true) bool(true)
NULL byte (“\ 0”) bool(true)  bool(false)  bool(false)

 

I have tested the above values in PHP 7.1.9 which was released on September 1, 2017.

UK Telehealth is finally coming of age.

According to new a research report, around 2.2 million patients worldwide are using a home monitoring service based on equipment with integrated connectivity at the end of 2011. The figure does not include patients that use monitoring devices connected to a PC or mobile phone. It only includes systems that rely on monitors with integrated connectivity or systems that use monitoring hubs with integrated cellular or fixed-line modems. It is forecast that the number of home monitoring systems with integrated communication capabilities will grow at a compound annual growth rate (CAGR) of 18.0 percent between 2010 and 2016 reaching 4.9 million connections globally by the end of the forecast period. The number of these devices that have integrated cellular connectivity increased from 0.42 million in 2010 to about 0.57 million in 2011, and is projected to grow at a CAGR of 34.6 percent to 2.47 million in 2016.

Some of the most common conditions being monitored today are chronic diseases including cardiac arrhythmia, sleep apnea, diabetes and chronic obstructive pulmonary disease (COPD). These conditions cause substantial costs and reduce both life expectancy and quality of life. It is estimated that more than 200 million people in the EU and the US suffer from one or several chronic diseases where home monitoring can become a treatment option. “Home monitoring solutions that can communicate over a cellular network, landline connection or the Internet have already reached significant volumes within cardiac rhythm management, integrated telehealth solutions, sleep therapy and cardiac event monitoring”, says Lars Kurkinen, Telecom Analyst, Berg Insight. He adds that connectivity is gaining momentum in several other segments as well, such as glucose meters and medication adherence systems.

Exploiting connectivity technologies in the UK healthcare industry can lead to decreased costs, more efficient care delivery and improved sustainability of the healthcare system. New care models enabled by these technologies are also often consistent with patients’ preferences of living more healthy, active and independent lives in their own homes. Progress is being made in the adoption of wireless technology among manufacturers of medical monitoring equipment. However, there is still a long way to go before remote monitoring becomes a standard practise in the healthcare sector.

Rustyice Solutions is monitoring this sector very closely and has already made some strategic moves in respect of this field. Keep an eye on this Blog for further announcements coming soon.

Inmarsat Fleet Global – The Maritime Communications Solution

Fleet Broadband is the smallest, most simple high speed Internet & telephone receiver for maritime communication. It can be set up by an individual with little or no training and operates globally, also requiring no particular training to keep it functioning. A fleet broadband antenna and controller are self contained, requiring only power. Switch it on, and your entire fleet is linked at broadband speed. This appliance can be rapidly implemented across your fleet and as a standard IP service, seamlessly integrated with corporate and headquarter networks. The service is such that anybody who operates a vessel of almost any size can easily see the benefit of the technology which reaches far beyond its cost. Contact us today to discuss the benefits Fleet Broadband can bring to your company. Read on for a flavour of these benefits:

 

Flexibility and control: Fleet Broadband supports the newest IP services, as well as traditional circuit-switched voice and data for your Current applications. You can choose between a standard, contended IP service and guaranteed data rates on demand – with the ability to choose the rate according to your application. 3 varieties of terminals are available, each present distinct performance capabilities.

Cost effective: With Fleet Broadband, performance and flexibility is not too pricey. Terminal costs are fairly low, with a selection of airtime pricing packages to best suit your needs. There is also no obligation to commit to a lengthy contract. Global voice and broadband data services are more accessible than ever before, enabling you to achieve better operational efficiencies and reduce the expenses of crew communications.

Worldwide coverage: Fleet Broadband ensures you’re never out of touch, wherever you sail. Voice, fax, and data connectivity in the Indian and Atlantic Ocean Regions is available immediately. Inmarsat delivers global coverage – excluding the extreme polar regions.

Easy to install and integrate: Finding a space on your vessel for your new FleetBroadband terminal shouldn’t be a problem. With the antenna set inside a neat radome cover, which ranges in diameter from 25 to 60cm, and a discrete below-decks terminal, Fleet Broadband is compact without compromising performance. As a standard IP service it can be seamlessly integrated with your shorebased systems, making your vessel a transparent link within your company network.

Inmarsat is one of the best providers of global satellite solutions in the world and Fleet Broadband is just one of those solutions. The Inmarsat solution provides global satellite communication, with multiple satellites covering the whole planet. Contact us today to discuss this or indeed any of the Inmarsat solutions which we will be blogging about in the coming weeks.

Can we really make Autonomic Network systems succeed?

The real world is uncertain. Thats a given. Our networks, at their most fundamental, carry the real world from one point to another and therefore by definition carry that uncertainty during every moment they operate. Any autonomic system which seeks to properly manage our networks faces this challenge of pervasive uncertainty. They will always be constructed around that dichotomy of bringing order to chaos by applying their adaptive techniques to create order from chaos. If we map too much of that adaptation into the systems, they become cumbersome and unwieldy. We therefore need to smooth the chaos curve in order to drive autonomic systems design in a direction that will maintain their efficacy. How might we do this? Read on for our thoughts.

We are currently engaged in a conflict with the increasingly complex systems we seek to create which we are losing. Things may have become easier for the end user(arguably), but these systems which provide the end user more simplicity mask a corresponding increase in the the complexity of the underlying systems which support them. This affects the economics of viability of new developments in the marketplace and actually makes some of them non-viable. This situation forces us into choices that we cannot make on an informed basis and our decisions may end up fossilising parts of the network so that future development becomes uneconomic or infeasible.

In principle, autonomic network systems are founded on the principle that we need to reduce the variability that passes from the environment to the network and its applications. In latter years, many companies including Rustyice Solutions have brought products to the market that simplify the management of networks by offering levels of abstraction which make configuration easier and allow the network to heal itself  on occasion. These products tend to smooth the chaos curve and increase the reliability of the systems without the involvement of a low level re-inspection of the systems themselves. They do this by integrating the available information from different semantic levels and leveraging it to give the systems a more holistic view from which to consider the operational status of themselves.

Lets consider what we expect of an autonomic system. It can be defined in terms of a simple feedback loop which comprises information gathering, analysis, decision making and taking action. If the system is working properly then this feedback loop will achieve and maintain balance. Examining these elements one by one, information gathering can come from network management platforms which talk to the discrete nework components on many levels as well as environmental and application based alerts. Analysis can mean such activities as applying rules and policies to the gathered information. Decision making is the application of the analysis against the rules and policies to determine whether or not they meet the conditions set out in the policies and taking action could involve adjusting network loads on managed elements and potentially informing humans who need to take some form of action. These are the fundamental terms with which we seek to understand any requirement from any of our own customers.

This sounds fine in theory but what do we need to understand in order to make it work? The network is currently modelled on a layer based concept where each of the layers has a distinct job to do and talks only to its neighbour layers as well as its corresponding layer at the distant end of the communications link. This model has served us well and brings many distinct advantages including hardware and software compatibility and interoperability, international compatibility, inter layer independence and error containment. It does however carry some disadvantages with it too and most significant of those in terms of this discussion is that of the lack of awareness at any point in the system of the metadata which is why we have the networked systems in the first place. The question of whether the network is doing what it is needed to do at the holistic level is something which no discrete layer ever asks, nor should it. It almost comes down to a division between the analogue concerns of the real world versus the digital, yes/no, abilities of the systems themselves.

Taking this discussion a step further we need to improve our ability to ascribe the real world requirements which are the reasons these networks exist and why we build them to the systems which we intend should be capable of making decisions about whether the systems are working or not. Can these systems really know whether or not the loss of a certain percentage of the packets in a data-stream originating on the netflix servers will impact the enjoyability of somebody watching the on demand movie they have paid for. From a higher perspective, the question becomes whether we can really design autonomic decision making systems that could understand the criteria the real world applies to the efficacy of the network and base their decisions on that finding. They also need to be aware of the impact any decisions they make will have on the efficacy of any other concurrent real world requirements.

There are many mathematical abstractions which seek to model this scenario in order to predict and design the autonomic behaviours we require of our systems and you will be relieved to read that we do not propose to go into those here. In principle however we need to move towards a universal theory of autonomic behaviour. We need to find an analytic framework that facilitates a conceptual decision making model relating to what we actually want from the network. We need to couple this with an open decision making mechanism along the lines of UML in order for us to fold in the benefits of new techniques as they develop and ultimately we need to be able to build these ideas directly into programming languages such that they better reflect the real world systems we want on a higher level of abstraction.

In conclusion, we can say that autonomics is a multi level subject and we need to take account of these different semantic levels. We need to build an assumed level of uncertainty into our programming in order to maximise our ability to engineer autonomic systems and we need to develop standards in order to further enable the capability of our systems in this area. These are the fundamental points which we at Rustyice Solutions begin any discussion with respect to network management and more especially autonomic networking such as WAN acceleration. If you or your business are interested in examining this topic in more detail with a view to enhancing the value which your network brings to the table why not give us a call. We look forward to hearing from you.