• Resolved JabaMS

    (@jabams)


    Hello to everyone. I’m trying to get an option from an plugin.

    <?php
    $options = get_option('cp_options');
    	foreach ( $options as $cp_options => $gateways ) {
    		foreach ( $gateways as $fsms => $fsecret ) {
    			foreach ( $fsecret as $sdd => $ko) {
    				//echo $sdd . "=" . $ko . "";
    				$options1[$sdd] = $ko;
    			}
    		}
    	}
    	var_dump($options1);
    ?>

    the result is:

    array(18) { ["bank-transfer"]=> bool(true) ["paypal"]=> bool(true) ["sms"]=> bool(false) ["fsms"]=> bool(true) ["message"]=> string(22) "Ovo je povratna poruka" ["email_address"]=> string(20) "[email protected]" ["business_account"]=> bool(false) ["sandbox_enabled"]=> bool(false) ["pdt_enabled"]=> bool(false) ["pdt_key"]=> string(0) "" ["ipn_enabled"]=> bool(false) ["_blank"]=> string(0) "" [""]=> string(0) "" ["fsecret"]=> string(32) "633428f6a25006161d2062sdf5a2ed24f5ef41" ["fmessage"]=> string(99) "Postovani, oglas broj $message je oznacen kao istaknut na www.kosovskioglasi.com po ceni od $price." ["fxmllink"]=> string(108) "https://api.fortumo.com/api/services/2/2sdsadasd.xml" ["fserviceid"]=> string(32) "bd30a773dassdf1ea247ed45c01b63b34b1664c" ["costofsms"]=> string(1) "5" }.

    My question is how to echo only fsecret value from this example

Viewing 4 replies - 1 through 4 (of 4 total)
  • Moderator keesiemeijer

    (@keesiemeijer)

    Hi JabaMS

    Can you post the results in a more readable format with this.

    echo '<pre>';
    print_r( $options1 );
    echo '</pre>';

    Thread Starter JabaMS

    (@jabams)

    Thank’s for your fast reply. Here is result:

    Array
    (
        [bank-transfer] => 1
        [paypal] => 1
        [sms] =>
        [fsms] => 1
        [message] => Ovo je povratna poruka
        [email_address] => [email protected]
        [business_account] =>
        [sandbox_enabled] =>
        [pdt_enabled] =>
        [pdt_key] =>
        [ipn_enabled] =>
        [_blank] =>
        [] =>
        [fsecret] => 628f6a25006161d20625a2ed24f5ef41
        [fmessage] => Postovani, oglas broj $message je oznacen kao istaknut na www.kosovskioglasi.com po ceni od $price.
        [fxmllink] => https://api.fortumo.com/api/services/2/2476f8bf38949ef6b03ffdc370052b12.35fec6b3b1d292261ecf56e19cc33d90.xml
        [fserviceid] => bd30a773d1ea247ed45c01b63bb1664c
        [costofsms] => 5
    )
    Moderator keesiemeijer

    (@keesiemeijer)

    Try it with:

    echo $options1['fsecret'];

    Thread Starter JabaMS

    (@jabams)

    Heh, i was shure that I tried this and that did not worked :D. Anyway now work’s. Thank you.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How to echo get_option’ is closed to new replies.