This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Copyright (C) 2016 The Android Open Source Project | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
get last word from url after a slash in php | |
preg_match("/[^\/]+$/", "http://www.mydomainname.com/m/groups/view/test", $matches); | |
$last_word = $matches[0]; // test | |
OR | |
Use basename with parse_url: | |
echo basename(parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example; | |
import android.content.Context; | |
import android.graphics.*; | |
import android.graphics.drawable.Drawable; | |
import android.graphics.drawable.NinePatchDrawable; | |
import android.util.AttributeSet; | |
import android.util.Log; | |
import android.widget.ImageView; |