• Resolved masini2002

    (@masini2002)


    Hello, thanks for helping me.

    I need to check if a property is for sale or for rent. I need a “SALE” value and a “RENT” value if there is no sales data.

    The structure is:

    {prices}
       {byOperation}
          <SALE>
              <price>288000</price>
          </SALE>
          <RENT>
       {/byOperation}
    {prices}

    Is there any way to get those two values depending on whether there is data or not?

    Thanks.

    • This topic was modified 5 years, 6 months ago by masini2002.
Viewing 1 replies (of 1 total)
  • Thread Starter masini2002

    (@masini2002)

    Solution:

    function funcion($element) {
    	if($element==NULL) {
    		return "RENT";
    	} else {
    		return "SALE";
    	}
    }
    • This reply was modified 5 years, 6 months ago by masini2002.
Viewing 1 replies (of 1 total)
  • The topic ‘Conditional that gives two values’ is closed to new replies.