Jump to content

split variables and assign


totallytech

Recommended Posts

Hey,

 

I've have a tiny little piece of code, which currently looks like:

<?php 
    printf( '<span class="cart-link"><a href="%1$s" title="%2$s">%3$s</a></span>',
    esc_url( $ImStore->get_permalink( "shopping-cart", true, false, $post->post_parent ) ),
    esc_attr__( 'Link to shopping cart', 'ims' ),
    __( 'Cart', 'ims' )
?>

which generates an href with the url to the shopping cart in.

 

How would I strip out the url - so I just end up with

 

echo "http://mystore.com/cart"; and nothing around it?

Link to comment
https://forums.phpfreaks.com/topic/296166-split-variables-and-assign/
Share on other sites

I suggest actually learning PHP so you'll understand what the code is doing and can figure out answers like "remove the parts you don't want" on your own.

echo $ImStore->get_permalink( "shopping-cart", true, false, $post->post_parent );

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.