• Marcus

    (@marcuss)


    Hello,

    I use the following code to print contact information.

    if (is_single()) {
            $company = get_field('firma');
            $company = explode('_', $company);
    		
    		if (isset($company[0]) && $company[0]!= 'keine') {
    		
    		echo '<p><strong>Kontaktdaten</strong>:<br />';
    		echo '<br />'. $company[0];        
    		if (isset($company[1]) && $company[1] != '|') {
    			echo '<br />'. $company[1];        
    		}
    		if (isset($company[2]) && $company[2]!='|') 
    			{
    			echo '<br />'. $company[2];        
    		}
    		if (isset($company[3]) && $company[3]!='|') 
    		{
    			echo '<br />'. $company[3];        
    		}		
    		echo '<br />'. $company[4]. ' '. $company[5];                
    		if (isset($company[6]) && $company[6]!='|') 
    		{
    			echo '<br />'. $company[6];        
    		}
    		if (isset($company[7]) && $company[7]!='|') 
    		{
    			echo '<br />' . '<a href="https://'. $company[7] . '">' . $company[7] . '</a><br />';
    		}
    		if (isset($company[8]) && $company[8]!='|') 
    		{
    			echo $company[8] ;        
    		}
    		/*if (isset($company[9]) && $company[9]!='|') 
    		{
    			echo '<br />' . '<a href="https://twitter.com/'. $company[9] . '">' . $company[9] . '</a><br />';        
    		}*/
    }
    }
    }
    

    The underscore is used as separator.

    The output looks like this:

    company
    address
    place
    Tel.
    Etc.

    Now I would have to add a possibly twitter account can use instead of the underscore another delimiter. For example, the rhombus

    When I enter the data in the selection list, which are as follows:

    Company_|_|_Address_Place_tel_etc.

    adjust accordingly, for example

    company#|#|#Adrress#Place#tel#etc

    there is the following issue in the frontend

    Company_address_place_tel_etc.

    Even clearing the cache does not fix the Problem.

    An idea why that could be?

    • This topic was modified 6 years ago by Marcus.
  • The topic ‘Problems with explode-sign’ is closed to new replies.